#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int p = n - 2 * k;
  int i = 1;
  int r = (n + p) / 2;
  while (r--) {
    cout << i << " " << i + 1 << " ";
    i = i + 2;
  }
  while (i <= 2 * n) {
    cout << i + 1 << " " << i << " ";
    i = i + 2;
  }
}
