#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, k, f = 0;
  cin >> n >> k;
  for (i = 1; i <= n - k; i++) cout << i << " ";
  while (i <= n) {
    if (f)
      cout << i++ << " ";
    else
      cout << n-- << " ";
    f ^= 1;
  }
}
