h,m=map(int,input().split(':')) x=(h*60+m)%1440 h=x//60 m=x%60 ans='' if h<10: ans+='0' ans+=str(h)+':' if m<10: ans+='0' ans+=str(m) print(ans)