#include <bits/stdc++.h>
using namespace std;
template <typename T>
void SOUT(T what) {
  cout << what << endl;
}
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i < (n + 1); ++i) {
    if (k) {
      cout << 2 * i - 1 << " " << 2 * i << " ";
      k--;
    } else {
      cout << 2 * i << " " << 2 * i - 1 << " ";
    }
  }
  cout << endl;
}
