#include using namespace std; using lint = long long; template using V = vector; template using VV = V< V >; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, x; cin >> n >> x; V<> res; auto add = [&](int l, int r) -> void { for (int i = l; i < r; ++i) { res.push_back(i); } }; if (n % 4 == 0) { add(1, 4); int m = n / 4 - 1; for (int i = 4; m; i += 4, --m) { if (i <= x and x < i + 4) continue; add(i, i + 4); } res.push_back(x); } else if (n % 4 == 1) { int m = n / 4; for (int i = 4; m; i += 4, --m) { if (i <= x and x < i + 4) continue; add(i, i + 4); } res.push_back(x); } else if (n % 4 == 2) { for (int i = x / 4 * 4; i < x / 4 * 4 + 4; ++i) if (i != x) { res.push_back(i); } add(1, 4); int m = n / 4; for (int i = 4; m; i += 4, --m) { if (i <= x and x < i + 4) continue; add(i, i + 4); } } else { for (int i = x / 4 * 4; i < x / 4 * 4 + 4; ++i) if (i != x) { res.push_back(i); } int m = n / 4; for (int i = 4; m; i += 4, --m) { if (i <= x and x < i + 4) continue; add(i, i + 4); } } for (int e : res) { cout << e << '\n'; } }