#include <bits/stdc++.h>
using namespace std;
using namespace std;
int n, k, a[100010];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= 2 * n; ++i) a[i] = i;
  for (int i = 1; i <= k; ++i) swap(a[2 * i - 1], a[2 * i]);
  for (int i = 1; i <= 2 * n; ++i) cout << a[i] << " ";
}
