import java.util.*; public class No652{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); String xx = sc.next(); if(!xx.contains(".")){ xx.concat(".0"); } double x; if(xx.contains("+")){ x = Double.parseDouble(xx.substring(4)); }else{ x = -Double.parseDouble(xx.substring(4)); } double diff = x - 9.0; int a_diff = (int)((diff*60)/60); int b_diff = (int)((diff*60)%60); int a_new = a + a_diff; int b_new = b + b_diff; if(b_new >= 60){ b_new -= 60; a_new += 1; }else if(b_new < 0){ b_new += 60; a_new -= 1; } if(a_new >= 24) a_new -= 24; else if(a_new < 0) a_new += 24; System.out.println(String.format("%02d", a_new) + ":" + String.format("%02d", b_new)); } }