h, s, tz = input().split() h, s = map(int, [h,s]) h_tz,s_tz = map(int,tz[3:].split(".")) tz = (h_tz*60+s_tz*6) 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)