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