#include <bits/stdc++.h>
using namespace std;
const int MOD = 10007;
const int mod = 998244353;
const int maxn = 2e5 + 1010;
const int dx[] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy[] = {1, 0, -1, -1, 1, -1, 1, 0};
long long a[maxn], b[maxn], c[maxn];
long long ans, n, m, len, k;
string s;
void solve() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    a[2 * i] = 2 * i - 1;
    a[i * 2 - 1] = 2 * i;
  }
  for (int i = m + 1; i <= n; i++) {
    a[i * 2] = 2 * i;
    a[i * 2 - 1] = 2 * i - 1;
  }
  for (int i = 1; i <= n * 2; i++) {
    cout << a[i] << " ";
  }
}
int main() {
  solve();
  return 0;
}
