#include <bits/stdc++.h>
int main() {
  int m, n, j, k, i, t;
  int a[100005];
  while (scanf("%d%d", &n, &m) != EOF) {
    int sum;
    if (m % 2 == 1) {
      a[0] = (m + 1) / 2;
      for (i = 1; i < m; i++) {
        if ((i + 1) % 2 == 0)
          a[i] = a[0] - (i + 1) / 2;
        else
          a[i] = a[0] + (i + 1) / 2;
      }
      j = 0;
      for (i = 1; i <= n; i++) {
        printf("%d\n", a[j]);
        j++;
        if (j >= m) j = 0;
      }
    }
    if (m % 2 == 0) {
      a[0] = (m + 1) / 2;
      for (i = 1; i < m; i++) {
        if ((i + 1) % 2 == 0)
          a[i] = a[0] + (i + 1) / 2;
        else
          a[i] = a[0] - (i + 1) / 2;
      }
      j = 0;
      for (i = 1; i <= n; i++) {
        printf("%d\n", a[j]);
        j++;
        if (j >= m) j = 0;
      }
    }
  }
  return 0;
}
