'''****** Задание ******** *В ожидании доставки. ''' N = int(input()) M = int(input()) T = int(input()) M = M + T N = (N + M // 60) % 24 M = M % 60 print(f'{N:02}:{M:02}')