#include<iostream>
using namespace std;

bool check(int x)
{
	if(x == 0) return true;
	int c = 0, sum = 0, t = x;
	
	while(x != 0)
	{
		c = x % 10; 
		sum = sum * 10 + c; 
		x /= 10; 
	}
	
	return sum == t;
}

int main()
{
	for(int i = 0; i <= 256; i ++)
	{
		if(check(i * i)) cout << i << endl;
	}
	return 0;
}