#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1, 0};
int dy[] = {1, -1, 0, 0, -1, 1, -1, 1, 0};
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  if (m == 1) {
    while (n--) cout << 1 << endl;
    return 0;
  }
  int i = (m + 1) / 2, j = (m + 1) / 2 + 1, kk = (m + 1) / 2;
  double k = (m + 1) / 2.0;
  map<int, int> cnt;
  for (int nn = (0); nn < (n); nn++) {
    if (cnt[i] < cnt[j])
      cout << i << endl, cnt[i]++, i--;
    else if (cnt[i] > cnt[j])
      cout << j << endl, cnt[j]++, j++;
    else {
      if (fabs(i - k) <= fabs(j - k))
        cout << i << endl, cnt[i]++, i--;
      else
        cout << j << endl, cnt[j]++, j++;
    }
    if (i < 1) i = kk;
    if (j > m) j = kk + 1;
  }
  return 0;
}
