#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i;
  cin >> n >> m;
  while (n) {
    if (m % 2 != 0) cout << (m + 1) / 2 << endl, n--;
    for (i = 0; i < m / 2 && n > 0; i++) {
      cout << m / 2 - i << endl;
      n--;
      if (n > 0)
        m % 2 == 0 ? cout << m / 2 + 1 + i << endl
                   : cout << m / 2 + 2 + i << endl,
            n--;
    }
  }
  return 0;
}
