#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  bool b = 0;
  if (k % 2) b = 1;
  int x = 1;
  for (int i = 1; k; i++, k--) {
    if (i % 2)
      cout << x++ << " ";
    else
      cout << n-- << " ";
  }
  if (b)
    for (int j = x; j <= n; j++) cout << j << " ";
  else
    for (int j = n; j >= x; j--) cout << j << " ";
  cout << endl;
  return 0;
}
