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