#include<stdio.h>
using namespace std;
int main(){
    
    for(int i =0;i<=256;i++){
        int temp = i*i;
        int re=0;
        while(temp!=0){
            re=re*10+temp%10;
            temp = temp/10;

        }
        if(re==i*i){
            printf("%d\n",i);
        }
    }
    return 0;
}