#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, t1 = 0, s = 0;
  cin >> n >> k;
  int a[2 * n + 1];
  for (int i = 1; i <= 2 * n; i++) a[i] = 2 * n - i + 1;
  for (int i = 3; i <= 2 * n; i += 4) swap(a[i], a[i + 1]);
  int t = n - 2 * k;
  t /= 2;
  for (int i = 3; i <= 2 * n && t > 0; i += 4, t--) swap(a[i], a[i + 1]);
  for (int i = 1; i <= 2 * n; i++) cout << a[i] << " ";
}
