H, M, S = raw_input().split() H = int(H) - 9 H %= 24 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 B = B * 6 H += A M += B X = abs(M) / 60 if M < 0: X *= -1 H += X 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)