Armstrong Number

A number N is an Armstrong number of order n (n being the number of digits) if abcd...=an +bn +cn +dn +...=N For example, 153 is an Armstrong number of order 3 because 13 +53 +33 =1+125+27=153. Likewise, 54748 is an Armstrong number of order 5 because 55 +45 +75 +45 +85 =3125+1024+16807+1024+32768=54748. In this problem you have to determine whether a given number is Armstrong number or not. Input The first line of input is an integer, T that determines the number of test cases. Each of the next T lines contain a positive integer N, where N ≤ 1000000000. Output For each line of input, there will be one line of output. If N is an Armstrong number print ‘Armstrong’, otherwise print ‘Not Armstrong’ (without the quotes). Sample Input 3 153 2732 54748 Sample Output Armstrong Not Armstrong Armstrong