#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int a[maxn];
int N, K;
int main() {
  while (scanf("%d%d", &N, &K) != EOF) {
    memset(a, 0, sizeof(a));
    for (int i = 1; i <= N; i += 2) a[i] = (i + 1) / 2;
    int cnt = N;
    for (int i = 2; i <= N; i += 2) a[i] = cnt--;
    if (K & 1)
      sort(a + K + 1, a + N + 1);
    else
      sort(a + K + 1, a + N + 1, greater<int>());
    for (int i = 1; i <= N; i++) printf("%d ", a[i]);
    printf("\n");
  }
  return 0;
}
