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