x=int(input("Enter a number of seconds: ")) minutes, seconds = divmod(x, 60) hours, minutes = divmod(minutes, 60) print('{:d}h {:02d}m {:02d}s'.format(hours, minutes, seconds))