#include <bits/stdc++.h>
using namespace std;
const int INF = -1u / 2;
const int size = 0;
const int MOD = 1;
int main(int argc, char const *argv[]) {
  int n, m;
  scanf("%d%d", &n, &m);
  int s = 1;
  int e = n;
  int k = m;
  while (1) {
    if (k > 0) {
      printf("%d ", e--);
      k--;
      if (k == 0) {
        for (int i(0); i <= (n - (m - k)) - 1; ++i) printf("%d ", e--);
        break;
      }
    }
    if (k > 0) {
      printf("%d ", s++);
      k--;
      if (k == 0) {
        for (int i(0); i <= (n - (m - k)) - 1; ++i) printf("%d ", s++);
        break;
      }
    }
  }
  return 0;
}
