x = int(input())
hours = 0
minutes = 0
seconds = 0
seconds += x % 60
seconds = str(seconds)
minutes += (x // 60) % 60
hours += x // 60 // 60
minutes = str(minutes)
hours = str(hours)
if len(seconds) == 1:
seconds = '0'+seconds
if len(minutes) == 1:
minutes = '0'+minutes
print(hours + ':' + minutes + ':' + seconds)
x = int(input())
hours = 0
minutes = 0
seconds = 0
seconds += x % 60
seconds = str(seconds)
minutes += (x // 60) % 60
hours += x // 60 // 60
minutes = str(minutes)
hours = str(hours)
if len(seconds) == 1:
seconds = '0'+seconds
if len(minutes) == 1:
minutes = '0'+minutes
print(hours + ':' + minutes + ':' + seconds)