#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  bool a[n];
  memset(a, false, sizeof(a));
  int l = 0;
  int r = n - 1;
  for (int i = 0; i < k; i++) {
    a[(i & 1) == 0 ? l : r] = true;
    if ((i & 1) == 0) {
      cout << 1 + l;
      l++;
    } else {
      cout << 1 + r;
      r--;
    }
    cout << " ";
  }
  if ((k & 1) == 1) {
    for (int i = 0; i < n; i++) {
      if (!a[i]) {
        cout << 1 + i << " ";
      }
    }
  } else {
    for (int i = n - 1; i >= 0; i--) {
      if (!a[i]) {
        cout << 1 + i << " ";
      }
    }
  }
  cout << endl;
  return 0;
}
