#include <bits/stdc++.h>
using namespace std;
const long long int maxi = 20000;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  vector<long long int> ans;
  for (long long int i = 1; i <= 2 * n; i++) ans.push_back(i);
  long long int i = 0;
  long long int x = 2 * k;
  while (x > 0) {
    swap(ans[i], ans[i + 1]);
    i += 2;
    x -= 2;
  }
  for (auto i : ans) cout << i << " ";
  cout << endl;
}
