#include <bits/stdc++.h>
using namespace std;
std::vector<int> build(int n, int k) {
  std::vector<int> v;
  n *= 2;
  if (k == 0) {
    for (int i = 1; i <= n; ++i) {
      v.push_back(i);
    }
    return v;
  }
  if (k == 1) {
    v = {1, 2, 4, 3};
    for (int i = 5; i <= n; ++i) {
      v.push_back(i);
    }
    return v;
  }
  v = {1, 1 + k, 2 + k, 2};
  for (int i = 3; i <= n; ++i) {
    if ((i != 1 + k) && (i != 2 + k)) {
      v.push_back(i);
    }
  }
  return v;
}
int main(int argc, const char* argv[]) {
  int n, k;
  cin >> n >> k;
  const std::vector<int> v = build(n, k);
  for (int x : v) {
    cout << x << " ";
  }
  cout << "\n";
  return 0;
}
