#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, i, lp, rp, sw;
  cin >> n >> m;
  lp = (m / 2);
  rp = lp + 1;
  sw = (m % 2);
  for (i = 0; i < n; i++) {
    if ((sw == 0 && lp == 0) || (sw == 1 && rp == (m + 1))) {
      lp = (m / 2);
      rp = lp + 1;
      sw = (m % 2);
    }
    if (sw) {
      cout << rp << endl;
      rp++;
    } else {
      cout << lp << endl;
      lp--;
    }
    sw ^= 1;
  }
  return 0;
}
