<Problem>
http://ntucoder.net/Problem/Details/98
Uses Crt;
Var check:boolean;
day,month,year:longint;
Begin
readln(day,month,year);
if (year mod 100=0) then check:=(year mod 400)=0 else check:=(year mod 4)=0;
day:=day+1;
if month=2 then begin
if check=true then if day>29 then begin day:=1; inc(month); end;
if check=false then if day>28 then begin day:=1; inc(month); end;
end;
case month of
1,3,5,7,8,10,12: if day>31 then begin day:=1; inc(month); end;
4,6,9,11: if day>30 then begin day:=1; inc(month); end;
end;
if month>12 then begin month:=1; inc(year); end;
writeln(day,' ',month,' ',year);
readln;
End.