#include using namespace std; int main(){ int i,j,n,x; 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; } n -= 4; } if(n==1){ cout << x << endl; } if(n==2){ cout << (x^1) << endl; cout << 1 << endl; } if(n==3){ cout << (x^3) << endl; cout << 1 << endl; cout << 2 << endl; } if(n==4){ cout << x << endl; cout << 1 << endl; cout << 2 << endl; cout << 3 << endl; } }