#include <bits/stdc++.h>
using namespace std;
int main() {
  bool vis[100005] = {};
  int n, k;
  cin >> n >> k;
  vector<int> diff;
  for (int i = 1; i <= k; i++) diff.push_back(i);
  int cur = 1;
  for (int i = 1; i <= n && diff.size(); i++) {
    cout << cur << " ";
    vis[cur] = 1;
    if (i % 2)
      cur += diff.back();
    else
      cur -= diff.back();
    diff.pop_back();
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) cout << i << " ";
  }
  return 0;
}
