#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int oo = 0x3f3f3f3f;
int main() {
  int N, K;
  cin >> N >> K;
  int v = 1 + K;
  if (K) {
    cout << v << " " << 1;
  } else {
    v = 2;
    cout << 1 << " " << 2;
  }
  int k = 2;
  for (int i = (2); i < (2 * N); i++) {
    if (k == v) k++;
    cout << " " << k;
    k++;
  }
  cout << endl;
}
