import re a, b, s = tuple(input().split()) a = int(a) b = int(b) u = a - 9 u = (24 + u if (u < 0) else u) * 60 + b tz_s = float(re.findall(r'UTC(.+)', s)[0]) s = u + 60 * tz_s s = 24 * 60 - s if s < 0 else s % (24 * 60) print('{:02}:{:02}'.format(int(s // 60), int(s % 60)))