#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,h,i;
	for(i=1000;i<=9999;i++){
		a=i/100;
		b=i%100;
		h=(a+b)*(a+b);
		if(h==i){
		    cout<<i<<endl; 
	    }
	}
	
}
/**************************************************************
	Problem: 1085
	User: huanglingkai
	Language: C
	Result: Compile Error
****************************************************************/