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