from math import ceil a, b, S = input().rstrip().split() a = int(a) b = int(b) c = float(S[3:]) - 9 c *= 60 d = b + (-1 if c < 0 else 1) * ceil(abs(c)) b = d % 60 a += d // 60 if a > 23: a -= 24 elif a < 0: a = 24 + a print(f"{a:02}:{b:02}")