def FindNonTrivialOrbit(generators):
    """
    Given a generating set <generators> (a Python list containing permutations),
    this function returns an element <el> with a nontrivial orbit in the group
    generated by <generators>, or <None> if no such element exists.
    (Useful for order computation / membership testing.)
    """
    if generators == []:
        return None
    n = generators[0].n
    for P in generators:
        for el in range(n):
            if P[el] != el:
                return el