beecrowd | 2505

Autopotential

By Hamilton José Brumatto, UESC BR Brazil

Timelimit: 1

Some numbers in mathematics, due to their uniquiness, are given a special name. Particularly, there is a set of numbers, we will call "Autopotential". A number N is called Autopotential when NN  gives a result where the last digits is, exactly, N. For example:

1: 1= 1 -> It is autopotential.
3: 3= 27 -> it is not autopotential.
10: 1010 = 10,000,000,000 -> It is not autopotential.
11: 1111 = 285,311,670,611 -> It is autopotential.

Input

The input is defined as several test cases. Each line represents a test case and contains a unique integer value N, where 0 < N < 1,000,000.

Output

For each test case from input, your program must generate on output one unique line that contains a single word: "SIM", if the value from input is an Autopotential numer, or "NAO" otherwise.

Input Sample Output Sample

1
3
6
10
11

SIM
NAO
SIM
NAO
SIM