#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[N], l = 0, r, n, p = 0;
void preencher(int d) {
  if (d == 0) return;
  int cur = 1;
  a[p] = cur;
  a[p + 1] = n - cur + 1;
  d--;
  p += 2;
  r--;
  l++;
  cur++;
  while (d) {
    a[p] = cur;
    d--;
    p++;
    if (d == 0) return;
    a[p] = n - cur + 1;
    d--;
    if (d == 0) return;
    p++;
    r--;
    l++;
    cur++;
  }
}
int main() {
  int k;
  scanf("%d %d", &n, &k);
  r = n;
  preencher(k - 1);
  for (int i = p; i < (int)n; i++) {
    a[i] = r--;
  }
  set<int> chk;
  for (int i = 1; i < (int)n; i++) {
    chk.insert(abs(a[i] - a[i - 1]));
  }
  if ((int)chk.size() != k) {
    l++;
    for (int i = p; i < (int)n; i++) {
      a[i] = ++l;
    }
  }
  chk.clear();
  for (int i = 1; i < (int)n; i++) {
    chk.insert(abs(a[i] - a[i - 1]));
  }
  assert((int)chk.size() == k);
  for (int i = 0; i < (int)n; i++) {
    printf("%d ", a[i]);
  }
  return 0;
}
