#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, K;
  scanf("%lld", &N);
  scanf("%lld", &K);
  vector<long long> a;
  for (int n = 0; n < N; ++n, --K) {
    if (K > 0) {
      a.push_back(2 * n + 2);
      a.push_back(2 * n + 1);
    } else {
      a.push_back(2 * n + 1);
      a.push_back(2 * n + 2);
    }
  }
  for (int n = 0; n < a.size(); ++n) {
    cout << a[n] << " ";
  }
  cout << endl;
  return 0;
}
