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