By Hamilton José Brumatto, UESC Brazil
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: 11 = 1 -> It is autopotential.
3: 33 = 27 -> it is not autopotential.
10: 1010 = 10,000,000,000 -> It is not autopotential.
11: 1111 = 285,311,670,611 -> It is autopotential.
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.
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 |
SIM |