#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1e6 + 1;
const long long PRIME = 1e9 + 7;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<long long> ans;
  for (long long i = 0; i < 2 * n; i++) {
    ans.push_back(i + 1);
  }
  long long i = 0;
  if (k != 0)
    while (k--) {
      swap(ans[i], ans[i + 1]);
      i += 2;
    }
  for (auto i : ans) {
    cout << i << " ";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
}
