mport math
s,v = map(int,input().split())
t = math.ceil(s/v) + 10
n = t // 60
m = t % 60
hour = 7
minute = 60
if t >= 60:
hour -= n
minute -= m
if m == 0:
hour += 1
print("0%d:00"%hour)
elif m <= 50:
print("0%d:%d"%(hour,minute))
elif m > 50:
print("0%d:0%d"%(hour,minute))
else:
minute -= m
if m <= 50:
print("0%d:%d"%(hour,minute))
elif m > 50:
print("0%d:0%d"%(hour,minute))