Algebra

No attempts yetTime limit1sMemory limit128 MB

Problem

The little math students have a hard time with algebraic structures, so the kindergarten decided to practice operations on permutations. To give the exercise some content, the teachers defined an unusual operation, the triangular operation.

A triangular operation takes three parameters ii, jj, kk, and the three are pairwise different (iji \ne j, jkj \ne k, kik \ne i). Applying it to a permutation moves the number at position ii to position jj, the number at position jj to position kk, and the number at position kk to position ii.

The identity permutation is the permutation that holds the number ii at position ii. The students have to decide whether the identity permutation can be turned into a given permutation by applying triangular operations repeatedly. You write the program that checks their answer.

Input

The input consists of several blocks. The first line of each block holds the number of elements of the permutation NN (3N1000003 \le N \le 100\,000). The second line holds NN pairwise distinct integers from 11 to NN, and that sequence is the target permutation.

The last line of the input holds a single 00. Do not process that line.

Output

Print one line for each block. Print Permutaci lze prevest. if the given permutation can be obtained from the identity permutation by a sequence of triangular operations, and print Matfyzacci maji smulu. if it cannot.