#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k;
  cin >> n >> k;
  int a[n + 2];
  j = 1;
  for (i = 1; i <= n; i += 2) {
    a[i] = j;
    j++;
  }
  j = n;
  for (i = 2; i <= n; i += 2) {
    a[i] = j;
    j--;
  }
  j = a[k];
  if (k % 2 == 0) {
    j--;
    for (i = k + 1; i <= n; i++) {
      a[i] = j;
      j--;
    }
  } else {
    j++;
    for (i = k + 1; i <= n; i++) {
      a[i] = j;
      j++;
    }
  }
  for (i = 1; i <= n; i++) cout << a[i] << " ";
}
