#include <bits/stdc++.h>
using namespace std;
constexpr int N = 5e4 + 5;
int n, m;
int c[N * 2];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n * 2; ++i) c[i] = i;
  for (int i = 1; i <= m; ++i) swap(c[i * 2 - 1], c[i * 2]);
  for (int i = 1; i <= n * 2; ++i) printf("%d%c", c[i], " \n"[i == n * 2]);
  return 0;
}
