s,v=map(int,input().split()) t=s/v+10 h1=(480-t)//60 m1=(480-t)%60 h2=(t-480)//60 m2=(t-480)%60 if 0<=t<8*60: print("%.2d:%.2d"%(h1,m1)) elif 8*60<t<=24*60+8*60: print("%.2d:%.2d"%(h2,m2))