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