#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
  while (scanf("%d%d", &n, &k) != EOF) {
    int temp;
    temp = n - k;
    for (int i = 1; i <= temp; i++) printf("%d ", i);
    temp++;
    while (temp <= n) {
      printf("%d ", n);
      n--;
      if (temp <= n)
        printf("%d ", temp), temp++;
      else
        break;
    }
  }
  return 0;
}
