#include <stdio.h>
#include <stdlib.h>

int reverse(int x){
    int reve=0;
  while(x!=0){
    reve*=10;
    reve+=x%10;
    x/=10;
  }
 return reve;
}
int main()
{
    for(int i=0;i<=256;i++){
            int j=i*i;
        if (reverse(j)==j){
            printf("%d\n",i);
        }
    }
}