#include <iostream>
#include <math.h>
using namespace std;
bool checkAuto(int a){
if(a < 0) a = -a;
int squareNum = a*a;
int temp = a;
int count = 0; // count of digit of a
int lastNum = 0;
while(temp > 0){
count++;
temp = temp/10;
}
int lastDigit = (squareNum)%(int(pow(10, count)));
if(lastDigit == a) return true;
else return false;
}
int main() {
int num = -4;
if(checkAuto(num)) cout << "Automorphic";
else cout << "Not Automorphic";
cout << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWF0aC5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpib29sIGNoZWNrQXV0byhpbnQgYSl7CmlmKGEgPCAwKSBhID0gLWE7CglpbnQgc3F1YXJlTnVtID0gYSphOwoJaW50IHRlbXAgPSBhOwoJaW50IGNvdW50ID0gMDsgLy8gY291bnQgb2YgZGlnaXQgb2YgYQoJaW50IGxhc3ROdW0gPSAwOwoJd2hpbGUodGVtcCA+IDApewoJCWNvdW50Kys7CgkJdGVtcCA9IHRlbXAvMTA7Cgl9CglpbnQgbGFzdERpZ2l0ID0gKHNxdWFyZU51bSklKGludChwb3coMTAsIGNvdW50KSkpOwoJaWYobGFzdERpZ2l0ID09IGEpIHJldHVybiB0cnVlOwoJZWxzZSByZXR1cm4gZmFsc2U7Cn0KaW50IG1haW4oKSB7CmludCBudW0gPSAtNDsKaWYoY2hlY2tBdXRvKG51bSkpIGNvdXQgPDwgIkF1dG9tb3JwaGljIjsKZWxzZSBjb3V0IDw8ICJOb3QgQXV0b21vcnBoaWMiOwpjb3V0IDw8IGVuZGw7CnJldHVybiAwOwp9Cg==