A numbwer is called Factorian if it is equal to some of factorial of it's digits.
For example 145 is a factorian because 145=1! + 4! + 5!=1+24+120=145.
You task is to check if a number is factorian or not.
First Line Contains T denoting the number of test cases that follow.
Next T lines contains a positive Integer.
For every Input Integer,
If it an factorian Number , print FACTORIAN
else print NOT FACTORIAN
Every numnber is between 1 and 1000.
Problem Setter : Arjun Singh Bhatia