#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
set<long long> v1;
int main() {
  long long a, b, i, d;
  cin >> a >> b;
  d = b;
  long long s = a;
  long long e = 1;
  int count = 0;
  for (int i = 1; i <= a; i++) {
    if (count % 2 == 0) {
      v.push_back(s);
      s--;
    } else {
      v.push_back(e);
      e++;
    }
    count++;
  }
  if (b == 1 || a == 1 || a == 2) {
    sort(v.begin(), v.end());
  } else {
    int co = b - 1;
    for (i = 2; i < v.size(); i++) {
      co--;
      if (co == 0) break;
    }
    if (i < v.size()) {
      sort(v.begin() + i, v.end());
    }
  }
  for (int i = 0; i < v.size() - 1; i++) {
    v1.insert(abs(v[i] - v[i + 1]));
  }
  if (v1.size() > d) {
    swap(v[0], v[1]);
  }
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
