#include <bits/stdc++.h>
using namespace std;
int n, k, a[(int)1e5 + 5];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 0; i < 2 * n; i += 2) {
    if (k > 0)
      cout << i + 1 << " " << i + 2 << " ";
    else
      cout << i + 2 << " " << i + 1 << " ";
    k--;
  }
  cout << endl;
  return 0;
}
