#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  int up = 1, down = n;
  bool s = k % 2;
  for (; k > 0; k--) {
    if (s) {
      cout << up++ << ' ';
    } else {
      cout << down-- << ' ';
    }
    s = !s;
  }
  if (s) {
    while (up <= down) {
      cout << down-- << ' ';
    }
  } else {
    while (up <= down) {
      cout << up++ << ' ';
    }
  }
  return 0;
}
