#include <bits/stdc++.h>
using namespace std;
int N, M;
int main() {
  cin >> N >> M;
  double Mid = (double)(M + 1) / 2;
  int cnt1 = Mid, cnt2 = Mid + 1;
  for (int i = 1; i <= N; i++) {
    double dist1 = 2e9, dist2 = 2e9;
    if (cnt1 == 0 && cnt2 == M + 1) cnt1 = Mid, cnt2 = Mid + 1;
    if (cnt1 != 0) dist1 = fabs(cnt1 - Mid);
    if (cnt2 != M + 1) dist2 = fabs(cnt2 - Mid);
    if (dist1 <= dist2) {
      printf("%d\n", cnt1);
      cnt1--;
    } else {
      printf("%d\n", cnt2);
      cnt2++;
    }
  }
  return 0;
}
