#include <bits/stdc++.h>
using namespace std;
int a[2 * 50004];
int main(void) {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= 2 * n; i++) {
    a[i] = i;
  }
  for (int i = 1; i <= k; i++) {
    swap(a[2 * i], a[2 * i - 1]);
  }
  for (int i = 1; i <= 2 * n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
  return 0;
}
