#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  int curr_e = n;
  int curr_o = 1;
  bool z = false;
  for (int i = 0; i < k; ++i) {
    if (i % 2 == 1) {
      a[i] = curr_o;
      ++curr_o;
      z = false;
    } else {
      a[i] = curr_e;
      --curr_e;
      z = true;
    }
  }
  for (int i = k; i < n; ++i) {
    if (z) {
      a[i] = a[i - 1] - 1;
    } else
      a[i] = a[i - 1] + 1;
  }
  for (auto i : a) cout << i << " ";
  return 0;
}
