#include <iostream>

using namespace std;

int reverse (int n){
	int a = 0, b = 0;
	while (n != 0){
		a = n % 10;
		n /= 10;
		b = b * 10 + a;
	}
	return b;
}

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