def to_hms(sec):
    m, s = divmod(sec, 60)
    h, m = divmod(m, 60)
    return f"{h:02d}:{m:02d}:{s:02d}"
assert to_hms(3661) == "01:01:01"
assert to_hms(60) == "00:01:00"
print("SELF-TEST PASS")