#include <bits/stdc++.h>
using namespace std;
const int nm = 100005;
const int mm = 1005;
int n, k, m, t;
int a[nm];
bool check[nm];
int main() {
  int i, j, x, y, z, w;
  scanf("%d%d", &n, &k);
  for (i = 1; i <= n * 2; i++) a[i] = i;
  for (i = 1; i <= k; i++) swap(a[i * 2], a[i * 2 - 1]);
  for (i = 1; i <= n * 2; i++) printf("%d ", a[i]);
}
