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