#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int N = 100001;
int a[N];
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  int t = k + 1;
  for (int i = 0; i <= k; i++) a[i] = (i % 2 == 0) ? i / 2 + 1 : t--;
  for (int i = k + 1; i < n; i++) a[i] = i + 1;
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
  {
    int n;
    cin >> n;
  }
  return 0;
}
