#include <bits/stdc++.h>
using namespace std;
int arr[100005];
void B() {
  int n, k;
  cin >> n >> k;
  if (k == 1) {
    for (int i = 1; i <= n; i++) cout << i << " ";
  } else {
    int i1 = 1;
    int i2 = n;
    int con = n;
    for (int i = 0; i < n - k; i++) {
      cout << i2 << " ";
      i2--;
      con--;
    }
    int odd = 0;
    while (con--) {
      if (odd == 0) {
        cout << i1 << " ";
        i1++;
        odd = 1;
      } else {
        cout << i2 << " ";
        i2--;
        odd = 0;
      }
    }
  }
}
int main() {
  B();
  return 0;
}
