#include <bits/stdc++.h>
using namespace std;
int vis[100010];
int main() {
  int n, k, i, temp = 1;
  cin >> n >> k;
  i = k;
  cout << 1 << " ";
  vis[1] = 1;
  while (k--) {
    if (temp - i >= 1 && !vis[temp - i]) {
      cout << temp - i << " ";
      vis[temp - i] = 1;
      temp = temp - i;
      i--;
    } else if (!vis[temp + i]) {
      cout << temp + i << " ";
      vis[temp + i] = 1;
      temp += i;
      i--;
    }
  }
  for (int j = 1; j <= n; ++j) {
    if (!vis[j]) cout << j << " ";
  }
  return 0;
}
