import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int h = sc.nextInt(); int m = sc.nextInt(); String s = sc.next(); s = s.replaceAll("[UTC+]",""); double t = Double.parseDouble(s)-9.0; //tがマイナスなら時間を戻す。プラスなら進める。 t *= 60; int ans = (h*60+m)+(int)t; if (ans<0) { while (ans<0) { ans += 1440; } } int H = ans/60; H %= 24; int M = ans%60; String x = ""; if (H<10) {x+="0";} x+=H+":"; if (M<10) {x+="0";} x+=M; System.out.println(x); } }