#include <bits/stdc++.h>
using namespace std;
int ball[100005];
int main() {
  int n, m;
  cin >> n >> m;
  if (m % 2) {
    int mid = m / 2;
    int basket = mid;
    for (int i = 0; i < n; i++) {
      ball[i] = basket;
      if (m == 1) continue;
      if (basket == mid)
        basket--;
      else if (basket < mid)
        basket += 2 * (mid - basket);
      else if (basket > mid && basket != m - 1)
        basket -= 2 * (basket - mid) + 1;
      else if (basket > mid && basket == m - 1)
        basket = mid;
    }
  } else {
    int mid1 = m / 2 - 1, mid2 = m / 2;
    int basket = mid1;
    for (int i = 0; i < n; i++) {
      ball[i] = basket;
      if (basket <= mid1)
        basket += 2 * (mid1 - basket) + 1;
      else if (basket >= mid2 && basket != m - 1)
        basket -= 2 * (basket - mid2) + 2;
      else if (basket >= mid2 && basket == m - 1)
        basket = mid1;
    }
  }
  for (int i = 0; i < n; i++) cout << ball[i] + 1 << "\n";
}
