const 
	month : array[1..12] of longint = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

var     
	i, j, a, b, c, d, kol : longint;
	s, sa1, sa2, sb1, sb2, sc1, sc2 : string;
	st : array[0..10] of string;
	f, isDate : boolean;
	
function isLeap(y : longint) : boolean;
begin
	isLeap := (y mod 4 = 0) and (y <> 0); 
end;

function int(c : char) : longint;
begin
	int := ord(c) - 48;
end;     

function isGood(d, m, y : longint) : boolean;
begin
	if (d = 0) or (m = 0) or (m > 12) then
	begin
		isGood := false;
		exit;
	end;
	if (d > month[m]) then 
	begin
		isGood := false;
	end;
	if (isLeap(y)) then
	begin
		if (m = 2) and (d = 29) then isGood := true;
	end;
end;

begin
	reset(input, 'chronicle.in');
	rewrite(output, 'chronicle.out');
	readln(s);
	a := int(s[1]) * 10 + int(s[2]);
	b := int(s[4]) * 10 + int(s[5]);
	c := int(s[7]) * 10 + int(s[8]);
	kol := 0;
	for j := 1 to 6 do
	begin
		if (isGood(a, b, c)) then
		begin
			str(a div 10, sa1);
			str(a mod 10, sa2);
			str(b div 10, sb1);
			str(b mod 10, sb2);
			str(c div 10, sc1);
			str(c mod 10, sc2);
			s := sa1 + sa2 + '/' + sb1 + sb2 + '/' + sc1 + sc2;
			inc(kol);
			st[kol] := s;
		end;
		d := a;
		a := b;
		b := c;
		c := d;
		if (j = 3) then
		begin
			d := a;
			a := b;
			b := d;
		end;
	end;
	//writeln(kol);
	isDate := false;
	for i := 1 to kol do
	begin
		f := true;
		for j := 1 to i - 1 do
			if st[j] = st[i] then f := false;
		if f then 
		begin
			writeln(st[i]);
			isDate := true;
		end;
	end;
	if (isDate = false) then
		writeln('No such date');
	close(output);
		
end.
