#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, k, bottom, top;
  cin >> n >> k;
  bottom = 1;
  top = n;
  for (long i = 0; i < k - 1; i++) {
    if (i % 2 == 0) {
      cout << bottom << " ";
      bottom++;
    } else {
      cout << top << " ";
      top--;
    }
  }
  long sum, val;
  if ((k - 1) % 2 == 0) {
    val = bottom;
    sum = 1;
  } else {
    val = top;
    sum = -1;
  }
  for (long i = 0; i <= n - k; i++) {
    cout << val << " ";
    val += sum;
  }
  return 0;
}
