def convert(x,y):
    """
    converts a set and a dict into the required "X" format for algX
    for instance:

    X = {1, 2, 3, 4, 5, 6, 7}

    Y = {
    'A': [1, 4, 7],
    'B': [1, 4],
    'C': [4, 5, 7],
    'D': [3, 5, 6],
    'E': [2, 3, 6, 7],
    'F': [2, 7]}

    outputs:
    {
    1: {'A', 'B'},
    2: {'E', 'F'},
    3: {'D', 'E'},
    4: {'A', 'B', 'C'},
    5: {'C', 'D'},
    6: {'D', 'E'},
    7: {'A', 'C', 'E', 'F'}}

    """

    x = {j: set() for j in x}
    for i in y:
        for j in y[i]:
            x[j].add(i)
    return x