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