# Factorian

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.

**Input**

First Line Contains T denoting the number of test cases that follow.

Next T lines contains a positive Integer.

**Output**

For every Input Integer,

If it an factorian Number , print FACTORIAN

else print NOT FACTORIAN

**constraints**

T<=1000

Every numnber is between 1 and 1000.

**Sample Input**

2

145

146

**Sample output**

FACTORIAN

NOT FACTORIAN

*Problem Setter : Arjun Singh Bhatia*

**Languages:**Brain,C,C++,Java,Pascal,Perl,PHP,Python,Ruby,Text