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