import java.util.Scanner; class Main{ public static void main(String[]$) { Scanner s=new Scanner(System.in); int t=2880+s.nextInt()*60+s.nextInt() +(int)((Double.parseDouble(s.next().substring(3))-9)*60); t%=1440; System.out.printf("%02d:%02d\n",t/60,t%60); } }