#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int arr[N];
int n, k;
int main() {
  ios_base::sync_with_stdio(0);
  ;
  cin >> n >> k;
  int l = 1, r = n;
  int mark;
  for (int i = 1; i <= n; i++) {
    if (k) {
      if (i & 1)
        arr[i] = l++;
      else
        arr[i] = r--;
      --k;
    }
    if (k == 0) {
      mark = i;
      break;
    }
  }
  if (mark % 2) {
    for (int i = mark + 1; i <= n; i++) arr[i] = l++;
  } else {
    for (int i = mark + 1; i <= n; i++) arr[i] = r--;
  }
  for (int i = 1; i <= n; i++) cout << arr[i] << " ";
}
