t=0 while 1:r=raw_input();x=int(r[3:5])*60+int(r[6:])-t;print r+" 00:%02d:%02d"%(x/60%60,x%60);t+=x