time=eval(input())//1000
hour=time//3600
miu=(time-hour3600)//60
second=(time-hour3600-miu*60)%60
if hour<10:
new_hour=str(hour).zfill(2)
elif hour>=10 and hour<=24:#日
new_hour=hour
else:
new_hour=str(hour%24).zfill(2)
res=”{}:{}:{}”.format(new_hour,str(miu).zfill(2),str(second).zfill(2))
print(res)