t, s = divmod(int(eval(input())), 60)

h, m = divmod(t, 60)

print((str(h) + ':' + str(m) + ':' + str(s)))
t, s = divmod(int(input()), 60)

h, m = divmod(t, 60)

print(h, m, s, sep=':')

t, s = divmod(int(eval(input())), 60)
h, m = divmod(t, 60)
print((str(h) + ":" + str(m) + ":" + str(s)))

t, s = divmod(int(input()), 60)
h, m = divmod(t, 60)
print(h, m, s, sep=":")

-t, s = divmod(int(eval(input())), 60) +t, s = divmod(int(input()), 60) -print((str(h) + ":" + str(m) + ":" + str(s))) +print(h, m, s, sep=":")