#include <bits/stdc++.h>
const int maxn = 200000;
int a[maxn + 1];
int n, m;
int main() {
  int i, p1, p2, top;
  scanf("%d%d", &n, &m);
  top = 0;
  if (m % 2 == 1) {
    p1 = m / 2;
    p2 = p1 + 2;
    top = 1;
    a[1] = p1 + 1;
  } else {
    p1 = m / 2;
    p2 = p1 + 1;
  }
  for (i = m / 2; i >= 1; --i) {
    a[++top] = p1;
    a[++top] = p2;
    --p1;
    ++p2;
  }
  int p = 1;
  for (i = 1; i <= n; ++i) {
    printf("%d\n", a[p]);
    ++p;
    if (p > m) p = 1;
  }
  return 0;
}
