Brightness of Brain Contest
Problem E
Time limit: 1 second Memory: 32 MB

Automorphic Numbers

The Problem

Recreational mathematics is mathematics that is fun and used as either as a diversion from serious mathematics or as a way of making serious mathematics understandable or palatable.  These are the pedagogic uses of recreational mathematics.  They are already present in the oldest known mathematics and continue to the present day. One of the topic of the recreational mathematics is the Automorphic numbers  which have many use in different  fields.

Automorphic numbers are those numbers whose square ends with the number itself:

52 = 25,
252 = 625,
762 = 5776.

The first automorphic numbers are 1, 5, 6, 25, 76,  ... By definition 0 is not an Automorphic Number and for this particular problem we will not consider 1 as an Automorphic Number.

Automorphic numbers have enormous application in mathematics. In this problem you are to determine whether a given number is Automorphic or not.

The Input

Each line containing a arbitrarily big integer. Some Automorphic number have leading zeros. So leading zeros must be considered as significant. Input is terminated by end of file.

The Output

If the input is an Automorphic number print ``Automorphic number of n-digit.'', where n is the number of digit of the integer which will not be greater then 2000. Otherwise print ``Not an Automorphic number.''.

Sample Input

5
76
34

Sample Output

Automorphic number of 1-digit.
Automorphic number of 2-digit.
Not an Automorphic number.

Suman Mahbub
Created: 01-09-2002
Updated: 14-12-2002