#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    int n, k;
    cin >> n >> k;
    vector<int> v(2 * n);
    int eve = 2, odd = 1;
    for (int i = 0; i < 2 * n; i++) {
      if (i % 2 == 0) {
        v[i] = eve;
        eve += 2;
      } else {
        v[i] = odd;
        odd += 2;
      }
    }
    int shift = k + 1;
    if (k % 2 != 0)
      swap(v[0], v[shift]);
    else {
      for (int i = 1; i < 2 * n;) {
        if (k > 0) {
          swap(v[i], v[i + 2]);
          i += 4;
          k--;
        } else
          break;
      }
    }
    for (auto ele : v) cout << ele << " ";
  }
  return 0;
}
