#include <bits/stdc++.h>
using namespace std;
long long arr[1000000];
int main() {
  long long n, k, i, j;
  cin >> n >> k;
  for (i = 1; i <= 2 * n; i++) {
    arr[i] = i;
  }
  for (i = 1; i <= 2 * k; i += 2) {
    j = arr[i];
    arr[i] = arr[i + 1];
    arr[i + 1] = j;
  }
  for (i = 1; i <= 2 * n; i++) {
    cout << arr[i] << " ";
  }
  cout << endl;
}
