a,b,s = input().split() d = float(s[3:]) - 9 da, db = map(int, str(d).split(".")) if d < 0: db *= -1 b = int(b) + db * 6 a = int(a) + da + (b >= 60) - (b < 0) print("{:02d}:{:02d}".format(a%24, b%60))