#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using dl = double;
const int N = 2e5 + 10;
ll aarray[200000 + 10];
ll magic[101][101];
vector<ll> primes;
bool prime[1000001];
int main() {
  ios_base::sync_with_stdio(false);
  string str;
  ll i, j, n, m, k, t;
  cin >> n >> k;
  memset(prime, true, sizeof(prime));
  vector<ll> ans;
  ll f, l;
  f = 1, l = n;
  for (i = 0; i < k; i++) {
    if ((i & 1) == 0) {
      cout << f << " ";
      f++;
    } else {
      cout << l << " ";
      l--;
    }
  }
  for (i = k; i < n; i++) {
    if ((k & 1)) {
      cout << f << " ";
      f++;
    } else {
      cout << l << " ";
      l--;
    }
  }
  cout << endl;
  return 0;
}
