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