def f(S): flag = 0 if S[0] == "+": flag = 1 S = S[1:] if "." not in S: return flag, int(S), 0 x, y = S.split(".") x, y = int(x), int(y) * 6 return flag, x, y def g(x): x = str(x) if len(x) == 1: return "0" + x return x a, b, s = input().split() a, b = int(a), int(b) a -= 9 flag, x, y = f(s[3:]) if flag: a += x b += y if b >= 60: b -= 60 a += 1 a %= 24 else: a -= x b -= y if b < 0: b += 60 a -= 1 a %= 24 print(g(a) + ":" + g(b))