#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, s = 0, ar[100001];
  cin >> a >> b;
  a <<= 1;
  for (int i = 0; i < a; i++) {
    ar[i] = a - i;
  }
  int i = 0;
  while (b--) {
    swap(ar[i], ar[i + 1]);
    i += 2;
  }
  for (int i = 0; i < a; i++) {
    cout << ar[i] << " ";
  }
  cout << "\n";
  return 0;
}
