sec=int(eval(input()))

print((":".join(map(str, [int(sec/3600), int(sec/60)%60, sec%60]))))
# encoding:utf-8



input = eval(input())



second = input % 60

minute = input / 60 % 60

hour = input / 60 / 60 % 60



print((":".join(map(str, (hour, minute, second)))))
sec = int(eval(input()))
print((":".join(map(str, [int(sec / 3600), int(sec / 60) % 60, sec % 60]))))

# encoding:utf-8
input = eval(input())
second = input % 60
minute = input / 60 % 60
hour = input / 60 / 60 % 60
print((":".join(map(str, (hour, minute, second)))))

-sec = int(eval(input())) -print((":".join(map(str, [int(sec / 3600), int(sec / 60) % 60, sec % 60])))) +# encoding:utf-8 +input = eval(input()) +second = input % 60 +minute = input / 60 % 60 +hour = input / 60 / 60 % 60 +print((":".join(map(str, (hour, minute, second)))))