a, b, S = input().rstrip().split() a = int(a) b = int(b) c = float(S[3:]) - 9 c *= 60 #print(c) d = b + (-1 if c < 0 else 1) * round(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}")