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