def toStrDig(n, dig) : s = str(n) if len(s) < dig : s = ('0' * (dig - len(s))) + s return s S = input().split() x = (int(S[0])-9+24)%24 + int(S[1])/60 y = float(S[2][3 : ]) z = x + y while z < 0 : z += 24 print(toStrDig((int(z))%24, 2) + ":" +toStrDig(int((z - int(z)) * 60 + 0.00000001), 2))