Suddenly, a wild Derek emerges from the shadows and surprises a student with a pop quiz! Derek asks the student multiplication questions, and if the student gets all the questions right, Derek awards the student with a whole chocolate bunny.
Input Specification
The first line of input contains one integer, , the number questions Mateo asked
The next lines contain three integers , and , being the multiplicand, multiplier and the student's product, respectively.
Output Specification
Output PERFECT
if the student got everything right, or IMPERFECT
if he did not.
Contraints
Sample Input 1
3
2 5 10
4 6 24
10 7 70
Sample Output 1
PERFECT
Sample Input 2
5
123 43 5289
23 343 7315
1 34 34
500 500 250000
2 5 10
Sample Output 2
IMPERFECT
Explanation for Sample Output 2
The second question was answered incorrectly. 23x343 is 7889, not 7315, so the quiz was imperfect
Comments