def to_timestamp(ts: int) -> str:
    """returns a [(h*):mm:]ss timestamp string from `ts: int`"""
    if ts == 0:
        return "0"

    _mm = ts // 60
    hh = _mm // 60
    mm = _mm - hh * 60
    ss = ts % 60

    return ":".join(
        [str(u).rjust(2, "0") for u in (hh, mm) if u != 0] + [str(ss).rjust(2, "0")]
    ).lstrip("0")