import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = sc.next(); String h = s.substring(0,2); String m = s.substring(3,5); int hh = Integer.parseInt(h); int mm = Integer.parseInt(m); int mf=0; if(mm<=54){ mm = mm+5; } else{ mm = mm+5-60; mf = 1; } if(mf==1){ hh = hh+1; if(hh==24){ hh =0; } } System.out.println(String.format("%02d:%02d",hh,mm)); } }