#include <bits/stdc++.h>
using namespace std;
string to_string(string s) { return '"' + s + '"'; }
string to_string(char s) { return string(1, s); }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A>
string to_string(A);
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool f = 1;
  string r = "{";
  for (const auto& x : v) {
    if (!f) r += ", ";
    f = 0;
    r += to_string(x);
  }
  return r + "}";
}
void debug_out() { cout << "\n"; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << " " << to_string(H);
  debug_out(T...);
}
const long long N = 100043;
long long fact[N];
long long add(long long x, long long y) {
  x += y;
  while (x >= 1000000007) x -= 1000000007;
  while (x < 0) x += 1000000007;
  return x;
}
long long mul(long long x, long long y) { return (x * 1ll * y) % 1000000007; }
long long mulmod(long long a, long long b) {
  long long res = 0;
  a = a % 1000000007;
  while (b > 0) {
    if (b % 2 == 1) res = (res + a) % 1000000007;
    a = (a * 2) % 1000000007;
    b /= 2;
  }
  return res % 1000000007;
}
long long binpow(long long x, long long y) {
  long long z = 1;
  while (y > 0) {
    if (y % 2 == 1) z = mul(z, x);
    x = mul(x, x);
    y /= 2;
  }
  return z;
}
long long inv(long long x) { return binpow(x, 1000000007 - 2); }
long long divide(long long x, long long y) { return mul(x, inv(y)); }
void precalc() {
  fact[0] = 1;
  long long i;
  for (i = 1; i < N; ++i) fact[i] = mul(i, fact[i - 1]);
}
long long C(long long n, long long k) {
  if (k > n) return 0;
  return divide(fact[n], mul(fact[n - k], fact[k]));
}
void solve() {
  int n, k, i, t;
  cin >> n >> k;
  vector<int> a, b;
  for (i = 1; i < 2 * n + 1; ++i)
    if (i % 2 == 0)
      a.emplace_back(i);
    else
      b.emplace_back(i);
  sort((a).rbegin(), (a).rend());
  sort((b).rbegin(), (b).rend());
  i = 0;
  while (i < k) {
    t = a[2 * i];
    a[2 * i] = a[2 * i + 1];
    a[2 * i + 1] = t;
    i++;
  }
  for (i = 0; i < n; ++i) cout << a[i] << " " << b[i] << " ";
  cout << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
