#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
void for_sublime() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  clock_t start = clock();
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  vector<int> seq(2 * n + 1);
  for (int i = 1; i < 2 * n + 1; i++) {
    seq[i] = i;
  }
  for (int i = 1; k > 0 && i + 2 <= 2 * n; k--) {
    int tmp = seq[i];
    seq[i] = seq[i + 2];
    seq[i + 2] = tmp;
    i = i + 3;
  }
  for (long long int i = (1); i <= (2 * n); i++) {
    cout << seq[i] << " ";
  }
  cout << endl;
  return 0;
}
