#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int arr[2 * n];
  for (int i = 0; i < (2 * n); i++) {
    arr[i] = i + 1;
  }
  int i = 0;
  while (k != 0) {
    swap(arr[i], arr[i + 1]);
    i = i + 2;
    k = k - 1;
  }
  for (int i = 0; i < (2 * n); i++) {
    cout << arr[i] << " ";
  }
}
