from fractions import Fraction

H, M, S = raw_input().split()
H = int(H)
M = int(M)
S = S[3:].split('.')
A = int(S[0])
B = 0 if len(S) <= 1 else int(S[1])
if A < 0:
    B *= -1
A -= 9
B = B * 6

H += A
M += B

H += B / 60
M %= 60

H %= 24
H = '0' + str(H) if H < 10 else str(H)
M = '0' + str(M) if M < 10 else str(M)

print str(H) + ':' + str(M)