a tree size n undirected connected graph consist n vertex cyclesconsider tree n vertex we tree invariant relative permutation pp1p2 pn vertex tree u v condition hold vertex u v connect edge vertex pu pv connect edgeyou give permutation p size n find tree size n invariant relative give permutation