#include <bits/stdc++.h>
using namespace std;
long long n, k, ans[100100];
int main() {
  cin >> n >> k;
  ans[1] = 1;
  for (long long i = 2; i <= n; i++) ans[2 * i - 1] = n + i;
  for (long long i = 1; i <= n; i++) ans[2 * i] = i + 1;
  swap(ans[2 * 1], ans[2 * k]);
  if (!k) {
    for (long long i = 1; i <= 2 * n; ++i) cout << i << ' ';
    cout << endl;
    return 0;
  }
  for (long long i = 1; i <= 2 * n; ++i) cout << ans[i] << ' ';
  cout << endl;
  return 0;
}
