#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
int main() {
  int n, k;
  cin >> n >> k;
  int ch = 1;
  int lstch = n;
  for (int i = 0; i < k; ++i) {
    if (i % 2 == 0) {
      printf("%i ", ch++);
    } else {
      printf("%i ", lstch--);
    }
  }
  cout.flush();
  if (k + 1 == n) {
    printf("%i", ch);
    return 0;
  }
  if (k % 2 == 0) {
    for (int i = lstch; i >= ch; --i) printf("%i ", i);
  } else
    for (int i = ch; i <= lstch; ++i) printf("%i ", i);
  return 0;
}
