import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String h = scan.next(); String m = scan.next(); String t = scan.next(); scan.close(); int H; int M; double k; if(h.charAt(0) == '0') { H = Integer.parseInt(h.substring(1, 2)); }else { H = Integer.parseInt(h.substring(0, 2)); } if(m.charAt(0) == '0') { M = Integer.parseInt(m.substring(1, 2)); }else { M = Integer.parseInt(m.substring(0, 2)); } if(t.charAt(4) == '0') { k = Double.parseDouble(t.substring(3, t.length())); }else { k = Double.parseDouble(t.substring(3, t.length())); } //System.out.println(H +" " + M +" " + k); int e = H * 60 + M - 540 + 1440 * 2 + (int)Math.round(k * 60); e = e % 1440; System.out.printf("%02d:%02d\n", e/60, e%60); } }