import java.util.ArrayDeque; import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); int h=sc.nextInt(); int m=sc.nextInt(); String str=sc.next(); str=str.substring(3, str.length()); int add_m=(int)(Math.round(Double.valueOf(str)*60)); m+=add_m; h=(h+m/60-9+24)%24; m%=60; if(m<0) { m+=60; h=(h-1+24)%24; } System.out.println(String.format("%02d",h)+":"+String.format("%02d", m)); } void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }