#include <bits/stdc++.h>
using namespace std;
int a[100005], n, k;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1, l = 1, r = n; i <= k; ++i) {
    if (i & 1)
      a[i] = l, ++l;
    else
      a[i] = r, --r;
  }
  for (int i = k + 1; i <= n; ++i) {
    if (k & 1)
      a[i] = a[i - 1] + 1;
    else
      a[i] = a[i - 1] - 1;
  }
  for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
  return 0;
}
