h, s, tz = input().split() h, s = map(int, [h,s]) a = 1 if tz[3] == "-": a = -1 if "." in tz: h_tz, s_tz = map(int,tz[4:].split(".")) else: h_tz, s_tz = int(tz[4:]), 0 tz = (h_tz*60+s_tz*6)*a s = (60*h+s-540+tz) % (24*60) h, s = map(str, [s // 60, s % 60]) if len(s) == 1: s = "0" + s if len(h) == 1: h = "0" + h print(h+":"+s)