def get_nth_combination(
        iterable,
        *,
        items: int,
        index: int,
):
    """

    Credit to:
        https://docs.python.org/3/library/itertools.html#itertools-recipes

    Examples:

    >>> wallet = [1] * 5 + [5] * 2 + [10] * 5 + [20] * 3
    >>> get_nth_combination(wallet, items=3, index=454)
    (20, 20, 20)
    >>> get_nth_combination(wallet, items=3, index=-1)
    (20, 20, 20)
    >>> get_nth_combination(wallet, items=3, index=455)
    Traceback (most recent call last):
     ...
    IndexError: Index 455 out of bounds
    >>> get_nth_combination(wallet, items=3, index=-454)
    (1, 1, 1)
    >>> get_nth_combination(wallet, items=len(wallet), index=0)
    (1, 1, 1, 1, 1, 5, 5, 10, 10, 10, 10, 10, 20, 20, 20)
    >>> get_nth_combination(wallet, items=len(wallet), index=1)
    Traceback (most recent call last):
     ...
    IndexError: Index 1 out of bounds

    """
    space = tuple(iterable)
    n = len(space)
    if items < 1:
        msg = f'Argument must be positive'
        raise ValueError(msg)
    if items > n:
        msg = f'Sample space has {n} items; Argument items cannot exceed that'
        raise ValueError(msg)
    c = 1
    k = min(items, n - items)
    for i in range(1, k + 1):
        c = c * (n - k + i) // i
    orig_index = index
    if index < 0:
        index += c
    if index < 0 or index >= c:
        msg = f'Index {orig_index} out of bounds'
        raise IndexError(msg)
    result = []
    while items:
        c, n, items = c * items // n, n - 1, items - 1
        while index >= c:
            index -= c
            c, n = c * (n - items) // n, n - 1
        result.append(space[-(n + 1)])
    return tuple(result)