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