#include <bits/stdc++.h>
using namespace std;
bool ya[1000000];
int main() {
  int n, k;
  int r = 1;
  cin >> n >> k;
  int resta = n - 1;
  ya[1] = true;
  cout << 1;
  if (k == 1) {
    for (int i = 2; i <= n; i++) cout << " " << i;
  } else {
    int h = k - 1;
    while (h > 0) {
      if (!ya[r + resta] && r + resta <= n) {
        r += resta;
      } else {
        r -= resta;
      }
      ya[r] = true;
      cout << " " << r;
      h--;
      resta--;
    }
    while (resta) {
      if (!ya[r + 1] && r + 1 <= n)
        r++;
      else
        r--;
      ya[r] = true;
      cout << " " << r;
      resta--;
    }
  }
  return 0;
}
