#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  int j = 1;
  int a[n + 2];
  int flag[100005] = {0};
  flag[1] = 1;
  cout << "1 ";
  for (int i = k; i >= 1; i--) {
    if (j - i > 0 && flag[j - i] == 0) {
      flag[j - i] = 1;
      j -= i;
    } else {
      flag[j + i] = 1;
      j += i;
    }
    cout << j << " ";
  }
  for (int j = 1; j <= n; j++) {
    if (flag[j] == 0) cout << j << " ";
  }
  return 0;
}
