while 1:t=raw_input();s=sum(60**(2-i%3)*int(t[3*i:][:2])for i in range(6));print t+"=%02u:%02u:%02u"%(s/3600%24,s/60%60,s%60)