import math import copy h, s, tz = input().split() h, s = map(int, [h,s]) tz = math.ceil(float(tz[3:])*60) 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)