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