import java.util.Scanner; public class No652 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int min = a*60 + b; String s = sc.next(); double utc; if(s.charAt(3) == '+') { utc = Double.parseDouble(s.substring(4)); }else { utc = Double.parseDouble(s.substring(3)); } min = (int)(min + (utc - 9) * 60) % 1440; if(min < 0) { min += 1440; } System.out.printf("%02d:%02d\n",min/60,min%60); } }