import random


def shuffle(lst, key):
    """
    implementation of Fisher-Yates algorithm with a key to shuffle a list
    :param lst: list to be shuffled
    :param key: shuffle key
    :return: shuffled list
    """
    random.seed(key)
    swap_list = [random.randint(0, len(lst) - 1) for _ in range(len(lst))]
    for i in range(len(lst)):
        to_swap = swap_list[i]
        lst[i], lst[to_swap] = lst[to_swap], lst[i]
    return lst