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