#include using namespace std; using ll = long long; //引数unzipには圧縮前のvectorを入れる int compress(vector& unzip, map& zip) { sort(unzip.begin(), unzip.end()); unzip.erase(unique(unzip.begin(), unzip.end()), unzip.end()); for (int i = 0; i < unzip.size(); i++) { zip[unzip[i]] = i; } return unzip.size(); } bool judge(vector& ans) { int n = ans.size(); for (ll x : ans) { if (x <= 0 || x > 100005) return false; } map dummy; return compress(ans, dummy) == n; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n, x; cin >> n >> x; vector ans; map dummy; mt19937 mt(0); do { ans.assign(n, 0); for (int i = 0; i < 17; i++) { vector b1(n, 0); if (x & (1 << i)) { int cnt = n / 2; cnt += 1 - cnt % 2; for (int j = 0; j < cnt; j++) b1[j] = 1; } else { int cnt = n / 2; cnt += cnt % 2; for (int j = 0; j < cnt; j++) b1[j] = 1; } shuffle(b1.begin(), b1.end(), mt); for (int j = 0; j < n; j++) { ans[j] |= (b1[j] << i); } } sort(ans.begin(), ans.end()); if (x & (1 << 17)) { ans[0] |= (1 << 17); } } while (!judge(ans)); for (ll x : ans) { cout << x << "\n"; } return 0; }