// warm heart, wagging tail,and a smile just for you! // // ▒█████▒▒ // ██████████▒ // ▒████████████▒ // ██████████████████ // ████████████████████▒ // ▒██████████████████████▒ // ▒███████████████████████ // ▒████▒▒▒▒▒▒█████████████████▒ // ███▒▒▒▒▒▒██████████████████████▒▒▒ // ▒██▒▒███████████████████████▒▒▒▒▒██████ // ▒█████████████████████████▒▒▒▒▒▒█████████▒ // ▒█████████████████████▒▒▒▒▒▒██████████████ // ▒████ ████▒▒▒▒▒████ ████▒ // ▒█████▒ ████ ▒▒▒▒███████ ████ ██████▒ // ▒██▒▒▒▒▒ ██████ █████████ ██████ ██▒▒▒██▒ // █████████ ████████ █████████ ████████ ▒▒▒▒█████ // ▒█████████ ██████ ████████▒ ██████ █████████ // ▒██████████ ████ █████▒▒▒▒▒▒ ████ ██████████ // ████████████ ▒▒▒▒▒▒▒████████ ███████████▒ // ▒██████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒███████████████████████████████████▒ // ███▒▒▒▒▒▒▒▒▒▒▒▒█████████████████████████████████████████▒▒████████▒ // ▒▒▒▒▒▒▒▒▒██████████████ ███████▒▒▒▒███████████ // █████████████████████████ ███████▒▒▒██████████████▒ // █████████████████████████████ ███████▒▒▒██████████████████▒ // ██████████████████████████████████████████████████████████████████████ // ██████████████████████████████████████████████████████████████████▒ // ▒█████████████████▒▒▒▒▒▒▒██████████████████████████████████▒▒▒ // #include "bits/stdc++.h" using namespace std; #define MOD 1000000007 //#define MOD 998244353 const double EPS = 1e-9; #define INF (1LL<<60) #define D double #define fs first #define sc second #define int long long #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i) #define REP(i,n) FOR(i,0,(n)) #define RREP(i,n) RFOR(i,0,(n)) #define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr) #define range(i,a,b) ((a)<=(i) && (i)<(b)) #define debug(x) cout << #x << " = " << (x) << endl; #define SP << " " << typedef pair P; typedef vector vec; typedef vector> mat; signed main(){ ios::sync_with_stdio(false); cin.tie(0); int n,x; cin >> n >> x; if(n%4==0){ cout << x << "\n" << 1 << '\n'; int cnt = n-2; FOR(i,3,10010){ if(i != x || i+1 != x){ cnt-=2; cout << i++ << "\n" << i << "\n"; } else i++; if(cnt==0) break; } } if(n%4==1){ cout << x << '\n'; int cnt = n-1; FOR(i,1,10010){ if(i != x || i+1 != x){ cnt-=2; cout << i++ << "\n" << i << "\n"; } else i++; if(cnt==0) break; } } if(n%4==2){ x ^= 1; if(x == 0) x = 2; cout << x << "\n" << 1 << '\n'; int cnt = n-2; FOR(i,3,10010){ if(i != x || i+1 != x){ cnt-=2; cout << i++ << "\n" << i << "\n"; } else i++; if(cnt==0) break; } } if(n%4==3){ x ^= 1; if(x == 0){ cout << 1 << "\n" << 2 << "\n" << 4 << "\n"; REP(i,n-3) cout << i+5 << "\n"; return 0; } cout << x << '\n'; int cnt = n-1; FOR(i,1,10010){ if(i != x || i+1 != x){ cnt-=2; cout << i++ << "\n" << i << "\n"; } else i++; if(cnt==0) break; } } return 0; }