ln=input().split() hour=int(ln[0]) minute=int(ln[1]) lag=float(ln[2].replace('UTC',''))-9.0 lagmin=60*(lag-int(lag)) hour=(hour+lag+24)%24 minute=round((minute+lagmin+60.0)%60,1) if hour<10: print('0%d:%d'%(hour,minute)) else: print('%d:%d'%(hour,minute))