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