#include <bits/stdc++.h>
using namespace std;
int ar[100005] = {0}, n, x, k;
int main() {
  cin >> n >> k;
  int t = n - 1, p, tt = 1;
  cout << 1;
  ar[1] = 1;
  for (int i = 1; i <= n; i++) {
    if (k == 1) break;
    if (i % 2 == 1)
      tt = tt + t;
    else
      tt = tt - t;
    ar[tt] = 1;
    t--;
    cout << " " << tt;
    k--;
  }
  if (tt <= n / 2) {
    for (int i = 2; i <= n; i++)
      if (ar[i] == 0) cout << " " << i;
  } else {
    for (int i = tt - 1; i >= 2; i--)
      if (ar[i] == 0) cout << " " << i;
  }
  cout << endl;
}
