#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k;
  cin >> n >> k;
  long long a[2 * n + 1];
  for (int i = 0; i < 2 * n + 1; ++i) {
    a[i] = i;
  }
  for (int i = 0; i < k; ++i) {
    swap(a[2 * i + 1], a[2 * i + 2]);
  }
  for (long long i = 2 * n; i > 0; i--) {
    cout << a[i] << " ";
  }
  return 0;
}
