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