#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, up, down;
  int ind = 1;
  cin >> n >> k;
  k++;
  up = n;
  down = 1;
  vector<int> ans;
  while (k != 1) {
    if (ind == 1)
      ans.push_back(up--);
    else
      ans.push_back(down++);
    ind *= -1;
    k--;
    n--;
  }
  if (ind == 1)
    while (n) {
      ans.push_back(down++);
      n--;
    }
  else
    while (n) {
      ans.push_back(up--);
      n--;
    }
  cout << ans[0];
  for (int i = 1; i < ans.size(); i++) cout << " " << ans[i];
}
