#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  priority_queue<pair<int, pair<int, int>>> q;
  for (int i = 0; i < m; i++) q.push({0, make_pair(-abs(m - 1 - 2 * i), -i)});
  for (int i = 0; i < n; i++) {
    auto x = q.top();
    q.pop();
    printf("%d\n", 1 - x.second.second);
    q.push({x.first - 1, x.second});
  }
}
