import java.util.ArrayList;
import java.util.Scanner;
/**
* 华为机试 下一秒
* @author qxl
*
*/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
String s = sc.nextLine();
System.out.println(nextSecond(s));
}
}
public static String nextSecond(String s){
s = s.replace(" ", "/");
s = s.replace(":", "/");
String[]str = s.split("/");
ArrayList<Integer>list1 = new ArrayList<Integer>();
list1.add(1);
list1.add(3);
list1.add(5);
list1.add(7);
list1.add(8);
list1.add(10);
list1.add(12);
ArrayList<Integer>list2 = new ArrayList<Integer>();
list2.add(4);
list2.add(6);
list2.add(9);
list2.add(11);
int i1 = Integer.parseInt(str[str.length-1])+1;//秒
if(i1<10){
str[str.length-1] = "0" + i1;
}
if(i1==60){
str[str.length-1] = "00";
int i2 = Integer.parseInt(str[str.length-2])+1;//分
if(i2<10){
str[str.length-2] = "0" + i2;
}
if(i2==60){
str[str.length-2] = "00";
int i3 = Integer.parseInt(str[str.length-3])+1;//时
if(i3<10){
str[str.length-3] = "0" + i3;
}
if(i3==24){
str[str.length-3] = "00";
int i4 = Integer.parseInt(str[2])+1;//日
if(i4<10){
str[2] = "0" + i4;
}
int i5 = Integer.parseInt(str[1]);//月
int i6 = Integer.parseInt(str[0]);//年
if(list1.contains(i5)){
if(i4==32){
str[2] = "01";
i5 = i5+1;
}
}
if(list2.contains(i5)){
if(i4==31){
str[2] = "01";
i5 = i5+1;
}
}
if(i5==2){
//能被4整除但不能被100整除,或能被400整除的年份为闰年,闰年二月有29天
if((i6%4==0&&i6%100!=0)||i6%400==0){
if(i4==30){
str[2] = "01";
i5 = i5+1;
}
}else{
if(i4==29){
str[2] = "01";
i5 = i5+1;
}
}
}
if(i5<10){
str[1] = "0" + i5;
}
if(i5==12){
str[1] = "01";
i6 = i6+1;
}
}
}
}
StringBuffer sb = new StringBuffer();
for(String ss:str){
sb.append(ss);
}
sb.insert(4, '/');
sb.insert(7, '/');
sb.insert(10, ' ');
sb.insert(13, ':');
sb.insert(16, ':');
return sb.toString();
}
}