a, b, S = input().split() a = int(a) - 9 b = int(b) if "+" in S: x = S[4:] if "." in x: x = x.split(".")[0] a += int(x) b += 30 else: a += int(x) else: x = S[4:] if "." in x: x = x.split(".")[0] a -= int(x) b -= 30 else: a -= int(x) if b < 0: b += 60 a -= 1 elif b >= 60: b -= 60 a += 1 a %= 24 print("{:0=2}:{:0=2}".format(a, b))