#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ if(n==2){ for(int i=0;i<10;i++){ for(int j=0;j<10;j++){ if(i*10+j==pow((i+j),2)){ cout<<i<<j<<endl; } } } } else if(n==4){ for(int i=0;i<100;i++){ for(int j=0;j<100;j++){ if(i*100+j==pow((i+j),2)){ if(i<10 and j<10){ cout<<"0"<<i<<"0"<<j<<endl; } else if(i>=10 and j<10){ cout<<i<<"0"<<j<<endl; } else if(i<10 and j>=10){ cout<<"0"<<i<<j<<endl; } else cout<<i<<j<<endl; } } } } else if(n==6){ for(int i=0;i<1000;i++){ for(int j=0;j<1000;j++){ if(i*1000+j==pow((i+j),2)){ if(i<10 and j<10){ cout<<"00"<<i<<"00"<<j<<endl; } else if(i>=10 and i<100 and j<10){ cout<<"0"<<i<<"00"<<j<<endl; } else if(i<10 and j<100 and j>=10){ cout<<"00"<<i<<"0"<<j<<endl; } else if(i>=10 and i<100 and j>=10 and j<100){ cout<<"0"<<i<<"0"<<j<<endl; } else if(i>=10 and i<100 and j>=100){ cout<<"0"<<i<<j<<endl; } else if(i>=100 and j<100 and j>=10){ cout<<i<<"0"<<j<<endl; } else if(i>=100 and j<10){ cout<<i<<"00"<<j<<endl; } else if(i<10 and j>=100){ cout<<"00"<<i<<j<<endl; } else cout<<i<<j<<endl; } } } } else if(n==8){ for(int i=0;i<10000;i++){ for(int j=0;j<10000;j++){ if(i*10000+j==pow((i+j),2)){ if(i<10 and j<10){ cout<<"000"<<i<<"000"<<j<<endl; } else if(i>=10 and i<100 and j<10){ cout<<"00"<<i<<"000"<<j<<endl; } else if(i<10 and j<100 and j>=10){ cout<<"000"<<i<<"00"<<j<<endl; } else if(i>=10 and i<100 and j>=10 and j<100){ cout<<"00"<<i<<"00"<<j<<endl; } else if(i>=10 and i<100 and j>=100){ cout<<"00"<<i<<"0"<<j<<endl; } else if(i>=100 and j<100 and j>=10){ cout<<"0"<<i<<"00"<<j<<endl; } else if(i>=100 and i<1000 and j>=100 and j<1000){ cout<<"0"<<i<<"0"<<j<<endl; } else if(i>=100 and i<1000 and j>=1000){ cout<<"0"<<i<<j<<endl; } else if(i>=1000 and j<1000 and j>=100){ cout<<i<<"0"<<j<<endl; } else if(i<10 and j>=1000){ cout<<"000"<<i<<j<<endl; } else if(i>=1000 and j<10){ cout<<i<<"000"<<j<<endl; } else if(i<1000 and i>=100 and j<10){ cout<<"0"<<i<<"000"<<j<<endl; } else if(i<10 and j>=100 and j<1000){ cout<<"000"<<i<<"0"<<j<<endl; } else cout<<i<<j<<endl; } } } } } }