import math a,b=map(int,input().split()) c=math.floor(a/b) c+=1 d=(c//60)+1 e=8-d f=(d-1)*60 g=c-f i=50-g print("0"+str(e)+":"+str(i))