#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
  scanf("%d%d", &n, &k);
  int l = n, r = 1, num = 0;
  while (k > 1) {
    if (num > 0) k--;
    num++;
    if (num % 2 != 0) {
      printf("%d ", l);
      l--;
    } else {
      printf("%d ", r);
      r++;
    }
  }
  if (num % 2 == 0) {
    while (num < n) {
      printf("%d ", r);
      ++r;
      ++num;
    }
  } else {
    while (num < n) {
      printf("%d ", l);
      --l;
      ++num;
    }
  }
  printf("\n");
}
