#include <bits/stdc++.h>
using namespace std;
int a[10000000];
void swap(int &x, int &y) {
  int temp;
  temp = x;
  x = y;
  y = temp;
}
int main() {
  ios_base::sync_with_stdio(0);
  int t, n, m, i, j, k, l, r;
  cin >> n >> k;
  for (i = 0; i < 2 * n; i++) a[i] = i + 1;
  while (k--) {
    swap(a[2 * k], a[2 * k + 1]);
  }
  for (i = 0; i < 2 * n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
  return 0;
}
