#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int i = 0, N = n;
  int j = 1;
  bool b = false;
  if (n == (k + 1)) b = true;
  while (k > 0 || b) {
    i++;
    if (i % 2 != 0) {
      cout << j << " ";
      j++;
    } else {
      cout << n << " ";
      n--;
    }
    k--;
    if (i == N) b = false;
  }
  if (i % 2 != 0) {
    for (int k = j; k <= n; k++) {
      cout << k << " ";
    }
  } else {
    for (int k = n; k >= j; k--) {
      cout << k << " ";
    }
  }
  return 0;
}
