def insert_thousands_separator(value: str, thousands: str) -> str:
    """
    Insert thousands separator at appropriate locations.

    :param value: String representation of a number, without thousands separators.
    :param thousands: The thousands separator.

    :return: String representation of the number, with thousands separators.

    >>> insert_thousands_separator("7654321", ",")
    '765,432,1'

    >>> insert_thousands_separator("654321", ";")
    '654;321'

    >>> insert_thousands_separator("54321", "_")
    '543_21'

    >>> insert_thousands_separator("0987654321", " ")
    '098 765 432 1'

    >>> insert_thousands_separator("432", ",")
    '432'

    >>> insert_thousands_separator("0", ",")
    '0'
    """
    value_left_side_rev = value
    for counter in range(1, (len(value) - 1) // 3 + 1):
        pos = counter * 3 + counter - 1
        value_left_side_rev = (
            f"{value_left_side_rev[:pos]}{thousands}{value_left_side_rev[pos:]}"
        )
    return value_left_side_rev