Q10433: Automorphic Numbers

在數學中有一個領域叫做娛樂數學(Recreational mathematics),他很好玩並且被使用在讓嚴肅的數學有趣或容易被瞭解一些。其中有一種叫做Automorphic numbers的數在很多領域都有使用到。

Automorphic number是那些平方之後其尾數和原來的數一樣的數,例如:

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

前幾個automorphic numbers為: 5, 6, 25, 76, ......。請注意:在這裡0和1我們並不視他們為automorphic numbers。在本問題中,給你一個數,請你判斷其是否為automorphic number.

Input

每組測試資料1列,有一個長度不大於2000的正整數,某些automorphic number最前面有0存在(leading zeros,如Sample Input的第4組測試資料)。這些leading zeros是有意義的。

Output

對每組測試資料輸出一列,如果是automorphic number,請輸出Automorphic number of n-digit.,在這裡n是輸入數的長度。否則請輸出Not an Automorphic number.

Sample Input

5
76
34
0081787109376
1
0

Sample Output

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