import java.io.*;
import java.util.HashSet;
import java.util.StringTokenizer;

public class chronicle_vd {
	BufferedReader in;
	StringTokenizer str;
	PrintWriter out;
	String SK;

	String next() throws IOException {
		while ((str == null) || (!str.hasMoreTokens())) {
			SK = in.readLine();
			if (SK == null)
				return null;
			str = new StringTokenizer(SK,"/");
		}
		return str.nextToken();
	};

	int nextInt() throws IOException {
		return Integer.parseInt(next());
	};

	double nextDouble() throws IOException {
		return Double.parseDouble(next());
	};

	long nextLong() throws IOException {
		return Long.parseLong(next());
	};

	int days[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	int nice[][][];

	void precalc() {
		nice= new int[100][100][100];
		for (int j = 1; j <= 12; j++)
			for (int k = 0; k <= 99; k++) {
				int vs = 0;
				if ((k > 0) && (k % 4 == 0))
					vs++;
				int end = days[j-1];
				if (j == 2)
					end+=vs;
				for (int i = 1; i <= end; i++)
				{
					nice[i][j][k] = 1;
				};

			}

	}

	String build(int x, int y, int z) {
		return x / 10 + "" + x % 10 + "/" + y / 10 + "" + y % 10 + "/" + z / 10
				+ "" + z % 10;
	}

	void solve() throws IOException {
		precalc();
		int x = nextInt();
		int y = nextInt();
		int z = nextInt();
		HashSet<String> res=new HashSet<String>();
		if (nice[x][y][z] == 1)
			res.add(build(x, y, z));
		if (nice[x][z][y] == 1)
			res.add(build(x, z, y));
		if (nice[y][x][z] == 1)
			res.add(build(y, x, z));
		if (nice[y][z][x] == 1)
			res.add(build(y, z, x));
		if (nice[z][y][x] == 1)
			res.add(build(z, y, x));
		if (nice[z][x][y] == 1)
			res.add(build(z, x, y));
		if (res.isEmpty())
			out.println("No such date");
		else
			for (String S : res)
				out.println(S);
		System.err.println(nice[29][02][0]);
	};

	void run() throws IOException {

		in = new BufferedReader(new FileReader("chronicle.in"));
		out = new PrintWriter("chronicle.out");
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new chronicle_vd().run();
	}

}
