#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l = 1, r, c = 0;
  cin >> n >> k;
  r = n;
  while (1) {
    if (k - c <= 1) break;
    cout << l << " ";
    l++;
    c++;
    if (k - c != 1) {
      cout << r << " ";
      r--;
      c++;
    }
  }
  if (k % 2 == 0)
    for (int i = r; i >= l; i--) {
      cout << i << " ";
    }
  else {
    for (int i = l; i <= r; i++) {
      cout << i << " ";
    }
  }
  return 0;
}
