# Chapter 1 Question 31
# seconds to hours:minutes:seconds
invalid = True
while(invalid):
    total_seconds = int(input("enter the number of seconds (1-86400): "))
    if(0 <= total_seconds <= 86400):
        invalid = False
    else:
        print("Please enter a valid value!")

# below should be good input...
hours = total_seconds // 3600
sec_left = total_seconds % 3600
minutes = sec_left // 60
sec_left = sec_left % 60
# print(str(hours)+":"+str(minutes)+":"+str(sec_left))
print(str(hours)+"h"+str(minutes)+"m"+str(sec_left)+"s")
