#include <bits/stdc++.h>
using namespace std;
int m, k;
int main() {
  scanf("%d %d", &m, &k);
  bool meven = (k % 2 == 0);
  m--;
  int mpos = (k + 1) / 2;
  int cpos = mpos;
  printf("%d\n", cpos);
  while (m-- > 0) {
    if (meven) {
      if (cpos <= mpos)
        cpos = k - cpos + 1;
      else
        cpos = k - cpos;
    } else {
      if (cpos == mpos)
        cpos--;
      else {
        if (cpos < mpos)
          cpos = k - cpos + 1;
        else
          cpos = k - cpos;
      }
    }
    if (cpos > k || cpos <= 0) cpos = mpos;
    printf("%d\n", cpos);
  }
  return 0;
}
