s,v=map(int.input().split()) t=s/v+10 rt=8*60-t ht=int(rt%60) mt=int(rt/60) print("%O2d:O2d"%(ht,mt))