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