#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, k;
  cin >> n >> k;
  int* arr = new int[n];
  for (int i = 0; i < n - k; i++) arr[i] = i + 1;
  int p = 0;
  for (int i = n - k; i < n; i++, p++) {
    if (p % 2 == 0) {
      arr[i] = arr[i - 1] + k - p;
    } else {
      arr[i] = arr[i - 1] - k + p;
    }
  }
  for (int i = 0; i < n; i++) cout << arr[i] << " ";
  delete[] arr;
  return 0;
}
