H,M,S,T=map(int,input().split())t=(H*3600+M*60+S+T*5400)%129600H=t//3600M=(t-H*3600)//60S=t-H*3600-M*60print(f"{H}:{M:02d}:{S:02d}")