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