using System;
public class NIT{
// Function to check Automorphic number
static bool isAutomorphic(int N)
{
// Store the square
int sq = N * N;
// Start Comparing digits
while (N > 0) {
// Return false, if any digit
// of N doesn't match with its
// square's digits from last
if (N % 10 != sq % 10)
return false;
// Reduce N and square
N /= 10;
sq /= 10;
}
return true;
// Driver Code
public static void Main()
int N = 5;
Console.Write(isAutomorphic(N) ? "Automorphic" : "Not Automorphic");