#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long TTT = 1e8 + 7;
int dirX[] = {0, -1, 0, 1, -1, 1, -1, 1};
int dirY[] = {-1, 0, 1, 0, 1, -1, -1, 1};
long long fact[0];
long long inv[0];
long long arr[0];
long long primes[0];
long long modPower(long long b, long long p) {
  if (p == 0) return 1;
  long long halfpow = modPower(b, p / 2);
  long long toReturn = (halfpow * halfpow) % mod;
  if (p % 2) toReturn = (toReturn * b) % mod;
  return toReturn;
}
long long fastPower(long long b, long long p) {
  if (p == 0) return 1;
  long long ans = fastPower(b, p / 2);
  ans = (ans * ans);
  if (p % 2 != 0) ans = (ans * b);
  return ans;
}
long long GcdRecursive(long long a, long long b) {
  if (b == 0) return a;
  return GcdRecursive(b, a % b);
}
long long modLCM(long long a, long long b) {
  long long val = GcdRecursive(a, b);
  long long tmp = ((a % mod) * (b % mod)) % mod;
  long long finalVal = ((tmp % mod) * (arr[val] % mod)) % mod;
  return finalVal;
}
long long LCM(long long a, long long b) { return (a * b) / GcdRecursive(a, b); }
void move1step(long long& a, long long& b, long long q) {
  long long c = a - q * b;
  a = b;
  b = c;
}
long long GcdIterative(long long a, long long b) {
  while (b) move1step(a, b, a / b);
  return a;
}
void pre(long long n) {
  fact[0] = 1;
  inv[0] = 1;
  for (long long i = 1; i <= n; i++) {
    fact[i] = (i * fact[i - 1]) % mod;
    inv[i] = modPower(fact[i], mod - 2);
    arr[i] = modPower(i, mod - 2);
  }
}
long long npr(long long n, long long r) {
  return ((fact[n] * inv[n - r]) % mod);
}
long long ncr(long long n, long long r) {
  return ((((fact[n] * inv[n - r]) % mod) * inv[r]) % mod);
}
void sieve(long long val) {
  memset(primes, 1, sizeof primes);
  primes[0] = primes[1] = false;
  for (int i = 2; i * i <= val; i++) {
    if (primes[i]) {
      for (int j = i * i; j <= val; j += i) {
        primes[j] = 0;
      }
    }
  }
}
set<long long> GetDivisors(long long val) {
  set<long long> st;
  for (long long i = 1; i < sqrt(val) + 1; i++)
    if (val % i == 0) st.insert(i), st.insert(val / i);
  return st;
}
long long power(long long b, long long e) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b, e / 2);
  return power(b * b, e / 2);
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
string findSmallestLexoWithoutDupilcates(string s) {
  int cnt[27];
  bool vis[27];
  for (int i = 0; i < s.size(); i++) cnt[s[i] - 'a']++;
  string ans = "";
  for (int i = 0; i < s.size(); i++) {
    int x = s[i] - 'a';
    cnt[x]--;
    if (vis[x]) continue;
    while (ans.size() > 0 && s[i] < ans.back() && cnt[ans.back() - 'a'] > 0) {
      vis[ans.back() - 'a'] = false;
      ans.pop_back();
    }
    ans.push_back(s[i]);
    vis[x] = true;
  }
  return ans;
}
long double dot(complex<long double> a, complex<long double> b) {
  return (conj(a) * b).real();
}
long double cross(complex<long double> a, complex<long double> b) {
  return (conj(a) * b).imag();
}
long double angleBetVec(complex<long double> a, complex<long double> b) {
  long double d = dot(a, b);
  d /= abs(a);
  d /= abs(b);
  return acos(d) * 180 / acos(-1);
}
complex<long double> RotateAbout(complex<long double> a,
                                 complex<long double> about,
                                 long double angle) {
  return (a - about) * polar((long double)1.0, angle) + about;
}
vector<int> topological_sort(const vector<vector<int>>& adj) {
  int n = int(adj.size());
  vector<int> in_degree(n, 0);
  vector<int> order;
  for (int i = 0; i < n; i++)
    for (int neighbor : adj[i]) in_degree[neighbor]++;
  for (int i = 0; i < n; i++)
    if (in_degree[i] == 0) order.push_back(i);
  int current = 0;
  while (current < int(order.size())) {
    int node = order[current++];
    for (int neighbor : adj[node])
      if (--in_degree[neighbor] == 0) order.push_back(neighbor);
  }
  return order;
}
const long long MOD = 998244353;
const long long N = 1e4 + 7;
const long long llinf = INT64_MAX;
const int intinf = INT32_MAX;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  vector<int> v(2 * n + 1);
  for (long long i = 1; i < 2 * n + 1; i++) v[i] = i;
  int idx = 1;
  for (int i = 0; i < k; i++) {
    swap(v[idx], v[idx + 1]);
    idx += 2;
  }
  for (long long i = 1; i < 2 * n + 1; i++) cout << v[i] << " ";
}
