import time while 1:a=raw_input();q=i=0;exec'q+=int(a[i:i+2])*60**(~i/3%3);i+=3;'*6;print a+"="+time.ctime(q+54e3)[11:19]