#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const double EPS = 1e-6;
int a[100005];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= 2 * n; i++) a[i] = i;
  for (int i = 1, j = 0; j < k; i += 2, j++) swap(a[i], a[i + 1]);
  for (int i = 1; i <= 2 * n; i++)
    printf("%d%c", a[i], i == 2 * n ? '\n' : ' ');
  return 0;
}
