#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, k;
int main() {
  cin >> n >> k;
  k--;
  int l = 1, r = n, b = 1;
  while (l <= r) {
    if (b)
      printf("%d", l++);
    else
      printf("%d", r--);
    if (k) b ^= 1, k--;
    if (l <= r) putchar(' ');
  }
  cout << endl;
  return 0;
}
