#include <bits/stdc++.h>
using namespace std;
void Solve() {
  int n, k;
  cin >> n >> k;
  bool is_top = true;
  int i = 1;
  int total = 1;
  cout << n << " ";
  while (k > 1) {
    cout << i << " ";
    is_top = false;
    --k;
    ++total;
    if (k > 1) {
      cout << n - i << " ";
      is_top = true;
      --k;
      ++i;
      ++total;
    }
  }
  if (is_top) {
    for (; total < n; ++total, ++i) {
      cout << n - i << " ";
    }
  } else {
    ++i;
    for (; total < n; ++total, ++i) {
      cout << i << " ";
    }
  }
  cout << endl;
}
int main() {
  Solve();
  return 0;
}
