import string


def idx_to_label(n: int) -> str:
    """Convert a number to a corresponding letter in the alphabet.
    In case the number is higher than the number of letters in the english alphabet, then
    a second character is appended.

    >>> For instance:
    >>>idx_to_label(0)
    >>> 'a'
    >>> idx_to_label(25)
    >>> 'z'
    >>> idx_to_label(26)
    >>> 'aa'

    This function was inspired after:
    https://stackoverflow.com/questions/2267362/how-to-convert-an-integer-to-a-string-in-any-base

    :param n: the input number
    :return: the corresponding string
    """
    alphabet_size = 26
    digits = []
    n += 1
    while n:
        digits.append(int(n % alphabet_size - 1))
        n //= alphabet_size

    digits.reverse()
    return ''.join([string.ascii_lowercase[i] for i in digits])