#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  int i, j;
  while (cin >> n >> k) {
    int l = 1;
    int r = n;
    int he = 1;
    for (i = 1; i <= n; i++) {
      if (he) {
        cout << (l++) << " ";
      } else {
        cout << (r--) << " ";
      }
      if (k == 1) continue;
      he = !he;
      k--;
    }
  }
  return 0;
}
