#include <bits/stdc++.h>
using namespace std;
int A[100005], m;
bool mf(int a, int b) {
  return fabs((m + 1) / 2.0 - a) < fabs((m + 1) / 2.0 - b) ||
         fabs((m + 1) / 2.0 - a) == fabs((m + 1) / 2.0 - b) && a < b;
}
int main() {
  int i, j = 1, n = 0, a, b, c;
  cin >> n >> m;
  for (i = 1; i <= m; ++i) {
    A[i] = i;
  }
  sort(A + 1, A + m + 1, mf);
  for (i = 1, j = 1; i <= n; ++i) {
    cout << A[j] << endl;
    j++;
    if (j > m) {
      j = 1;
    }
  }
  cout << endl;
  return 0;
}
