#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, k;
  cin >> n >> k;
  long j = 0;
  vector<long> v;
  for (int i = 1; i <= n; i++) {
    v.push_back(i);
  }
  swap(v[n - 1], v[n - k]);
  vector<int> temp;
  for (int i = 1; i < k; i++) {
    temp.push_back(v[n - k + i]);
  }
  sort(temp.begin(), temp.end());
  for (int i = 1; i < k; i += 2) {
    v[n - k + i] = temp[j];
    if (n - k + i + 1 < n) {
      v[n - k + i + 1] = temp[k - j - 2];
    }
    j++;
  }
  for (int i = 0; i < n; i++) {
    cout << v[i] << " ";
  }
}
