#include <bits/stdc++.h>
using namespace std;
int n, m, p;
int main() {
  scanf("%d%d", &n, &m);
  p = int((m + 1) / 2.0);
  while (n--) {
    printf("%d\n", p);
    if (p == m)
      p = int((m + 1) / 2.0);
    else if (p < (m + 1) / 2.0)
      p = m + 1 - p;
    else
      p = m - p;
  }
}
