def decipher(
        ciphertext: str,
        key: list[int],
        /,
) -> str:
    """
    Decrypts ciphertext encrypted by columnar transposition cipher using supplied key.

    IMPORTANT: We assume that the text is padded so that length of ciphertext is a multiple of key length
    """
    if len(ciphertext) % len(key):
        raise ValueError("Ciphertext length must be multiple of key length!")

    full_columns = len(ciphertext) // len(key)
    output = [list(' '*len(key)) for _ in range(full_columns)]

    for i, column in enumerate(key):
        for row in range(full_columns):
            output[row][i] = ciphertext[row + full_columns*column]
    output = ''.join([''.join(row) for row in output])
    if (padding_index := output.find('\ufffd')) != -1:
        return output[:padding_index]
    return output