#include #include #include using namespace std; int main(){ int n;cin>>n; if(n==1){ cout << 1521 << endl; }else if(n==2){ cout << 10649 << endl; }else{ vector x = {0,1,2,3,4,5,6,7,8,9}; vector k = {100000, 10000-100000, 1000, 1100-10010, 10, 101, 10000, 10-101, 1, -1000}; do{ if(x[0] == 0 || x[1] == 0 || x[6] == 0)continue; int cur = 0; for(int i = 0; 10 > i; i++){ cur = x[i]*k[i]; } if(cur == 0){ cout << x[1] << x[3] << x[9] << x[7] << x[3] << x[9] << endl; return 0; } }while(next_permutation(x.begin(), x.end())); } }