#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, j = 1, i, s;
  scanf("%d%d", &n, &m);
  vector<int> v;
  k = (m + 1) / 2;
  if (m % 2 == 0)
    s = -1;
  else
    s = 1;
  v.push_back(k);
  while (j <= ((m - 1) / 2)) {
    v.push_back(k - s * j);
    v.push_back(k + s * j);
    j++;
  }
  if (m % 2 == 0) v.push_back(m);
  j = i = 0;
  while (j < n) {
    printf("%d\n", v[i++]);
    j++;
    if (i == m) i = 0;
  }
  return 0;
}
