def permut(liste):

    P = [ 5, 9, 3, 6, 1, 4, 2, 7, 8]

    result = [ ]

    for i in P:

        result.append( liste[ i-1 ] )

        

    return result



def sigma(E, n):

    result = E

    for i in range(n):

        result = permut(result)

        

    return result

