#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int x = 0, y, i, p, j;
  for (i = 1, j = n; x < k;) {
    if (x % 2 == 0) {
      cout << i << " ";
      x++;
      y = i;
      i++;
    } else {
      cout << j << " ";
      x++;
      y = j;
      j--;
    }
  }
  if (y == (i - 1)) {
    for (p = i; p < j + 1; p++) cout << p << " ";
  } else {
    for (p = j; p > i - 1; p--) cout << p << " ";
  }
}
