a, b, s = input().split() a = int(a) b = int(b) c = float(s[3:]) - 9 t = int(a*60 + b + c*60) print('{0:02}:{1:02}'.format(t//60%24, t%60))