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