#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  while (cin >> n >> k) {
    int r = n, l = 1;
    cout << l;
    l++;
    for (int i = 1; i < k; i++)
      if (i % 2) {
        cout << " " << r;
        r--;
      } else {
        cout << " " << l;
        l++;
      }
    if (k % 2)
      for (int i = k; i < n; i++, l++) cout << " " << l;
    else
      for (int i = k; i < n; i++, r--) cout << " " << r;
    cout << endl;
  }
}
