s,v=map(int,input().split(" ")) time=s/v+10 hour=time//60 minute=time%60 H=8-hour M=60-minute if M >0: H=H-1 else: H=H M=int(M) H=int(H) template='{:0>2}:{:}' context=template.format(H,M) print(context)