#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(ll i=(a);i<(b);++i) #define per(i,a,b) for(ll i=(b-1);i>=(a);--i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define ctos(c) string(1,c) #define print(x) cout<<#x<<" = "<>n>>x; int x1 = x; if(x==1)x1=2; int n1 = n % 4; if(n1==0)n1+=4; n -= n1; vector v; v.pb(1); vector v1; for(int i = 2; i < 100000; i+=4){ if(i<=x1&&x10)v1.pb(j); n--; } } } do{ int a = 0; for(int i = 0; i < n1; i++){ a ^= v[i]; } if(a==x){ for(int i = 0; i < n1; i++){ v1.pb(v[i]); } break; } }while(next_permutation(all(v))); for(int i = 0; i < v1.sz; i++){ cout << v1[i] << endl; } return 0; }