#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,d;
    for(c=1000;c<=9999;c++){
        a=c%100;
        b=c/100;
        d=a+b;
        a=d*d;
        if(a==c){
            cout<<a<<endl;
        }
    }
}
/**************************************************************
	Problem: 1085
	User: fuyijun
	Language: C++
	Result: Accepted
	Time:4 ms
	Memory:2072 kb
****************************************************************/