#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int inf = 1e9 + 1;
const int Mod = 1e9 + 7;
const double eps = 1e-15;
const double EPS = 1e-9;
const double PI = acos(-1.0);
int GCD(int x, int y) {
  if (x % y == 0)
    return y;
  else
    return (GCD(y, x % y));
}
int main() {
  int n, k, i, j;
  cin >> n >> k;
  for (i = 0; i < k; i++) {
    if (i) cout << " ";
    cout << 2 * i + 2 << " " << 2 * i + 1;
  }
  for (i = k; i < n; i++) {
    if (i) cout << " ";
    cout << 2 * i + 1 << " " << 2 * i + 2;
  }
  cout << endl;
  return 0;
}
