#include <bits/stdc++.h>
using namespace std;
const int N = 1002000;
int n, k;
vector<int> ans;
int main() {
  int i, j;
  scanf("%d%d", &n, &k);
  for (i = 1; i <= n && i <= k; i++)
    ans.push_back(i * 2 - 1), ans.push_back(i * 2);
  for (; i <= n; i++) ans.push_back(i * 2), ans.push_back(i * 2 - 1);
  int first = 0;
  for (i = 0; i < ans.size(); i++) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
}
