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