#include <bits/stdc++.h>
using namespace std;
int result[101000];
int main() {
  int n, k;
  while (cin >> n >> k) {
    for (int i = 1; i <= 2 * n; i++) result[i] = i;
    int p = 1;
    for (int i = 0; i < k; i++) {
      int temp = result[p];
      result[p] = result[p + 1];
      result[p + 1] = temp;
      p = p + 2;
    }
    for (int i = 1; i <= 2 * n; i++) {
      cout << result[i];
      if (i != 2 * n) cout << " ";
    }
    cout << endl;
  }
  return 0;
}
