#include <bits/stdc++.h>
using namespace std;
int a[1000001];
int N, M;
int main() {
  while (scanf("%d%d", &N, &M) != EOF) {
    for (int i = 1; i <= 2 * N; i++) a[i] = i;
    for (int i = 1; i <= M; i++) {
      swap(a[i * 2 - 1], a[i * 2]);
    }
    for (int i = 1; i <= 2 * N; i++) cout << a[i] << " ";
    cout << endl;
  }
}
