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