#include <bits/stdc++.h>
using namespace std;
int s[2 * 50005];
int n, k;
int main() {
  while (scanf("%d%d", &n, &k) != EOF) {
    for (int i = 1; i <= 2 * n; i++) {
      s[i] = 2 * n - i + 1;
    }
    for (int i = 1; i <= 2 * k; i += 2) {
      swap(s[i], s[i + 1]);
    }
    for (int i = 1; i <= 2 * n; i++) cout << s[i] << " ";
    cout << endl;
  }
  return 0;
}
