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