#include <iostream>
#include <cstdio>

int Reverse(int x) {
    int revx = 0;
    while (x != 0) {
        revx = revx * 10 + x % 10;
        x = x / 10;
    }
    return revx;
}

int main() {
    for (int i = 0; i <= 256; i++) {
        if (Reverse(i * i) == i * i) {
            printf("%d\n", i);
        }
    }
    return 0;
}