#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  k *= 2;
  vector<int> a(2 * n);
  for (int i = 0; i < 2 * n; ++i) a[i] = i + 1;
  for (int i = 1; i < 2 * n; i += 2, k -= 2) {
    if (k > 0) swap(a[i], a[i - 1]);
  }
  for (auto x : a) printf("%d ", x);
  return 0;
}
