A,B,S=input().split() A=int(A) B=int(B) t=(A*60+B+round((float(S[3:])-9)*60)) h=t//60%24 m=t%60 print(str(h).zfill(2),":",str(m).zfill(2),sep="")