Check if a given number is perfect or not. A number is perfect if sum of factorial of its digit is equal to the given number. For example 145 is a Perfect Number because 1! + 4! + 5! = 145
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The next T lines will contain an integer N.
Corresponding to each test case, in a new line, print "Perfect " if it follow above condition else print "Not Perfect" without quotes.
1 ≤ T ≤ 50
1 ≤ N ≤ 10000