#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n, k, alt = 1, mini, maxi, cur;
  char last = '-';
  cin >> n >> k;
  cout << "1";
  cur = 1;
  maxi = n;
  n--;
  k--;
  mini = 2;
  while (n--) {
    if (alt && k) {
      cout << " " << maxi;
      cur = maxi;
      maxi--;
      alt = 0;
      k--;
      last = '+';
    } else if (k) {
      cout << " " << mini;
      cur = mini;
      mini++;
      alt = 1;
      k--;
      last = '-';
    } else {
      if (last == '+') {
        cur--;
        cout << " " << cur;
      } else {
        cur++;
        cout << " " << cur;
      }
    }
  }
  cout << endl;
}
