import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines H,M,utc = read().split() H = int(H) M = int(M) utc = float(utc[3:]) x = int(utc * 60) T = 60 * H + M - 540 + x T %= 1440 q,r = divmod(T,60) print('{:02}:{:02}'.format(q,r))