#include using namespace std; int main(){ int i,j,n,x,y = 0; cin >> n >> x; for(i=4;i<=100000;i+=4){ if(i==x/4*4) continue; if(n<=4) break; for(j=0;j<4;j++){ cout << i + j << endl; y ^= i + j; } n -= 4; } if(n==1){ cout << x << endl; } if(n==2){ if(x>1){ cout << (x^1) << endl; cout << 1 << endl; }else{ cout << 2 << endl; cout << 3 << endl; } } if(n==3){ if(x>3){ cout << (x^3) << endl; cout << 1 << endl; cout << 2 << endl; }else{ if(x>1){ cout << (100000^x) << endl; cout << 100001 << endl; cout << 1 << endl; }else{ cout << (100000^x) << endl; cout << 100002 << endl; cout << 2 << endl; } } } if(n==4){ if(x>3){ cout << x << endl; cout << 1 << endl; cout << 2 << endl; cout << 3 << endl; }else{ if(x<3){ cout << x << endl; cout << 3 << endl; cout << 100001 << endl; cout << 100002 << endl; }else{ cout << x << endl; cout << 100003 << endl; cout << 100001 << endl; cout << 2 << endl; } } } }