time,spend=input().split()
hour=int(time.split(':')[0])
minute=int(time.split(':')[1])
now_spend=hour*60+minute+int(spend)
hour=now_spend//60%24
minute=now_spend%60
print('{:02d}:{:02d}'.format(hour,minute))
time,spend=input().split()
hour=int(time.split(':')[0])
minute=int(time.split(':')[1])
now_spend=hour*60+minute+int(spend)
hour=now_spend//60%24
minute=now_spend%60
print('{:02d}:{:02d}'.format(hour,minute))