#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<int> a;
  int n, m, i;
  cin >> n >> m;
  int k = (m + 1) / 2;
  if (m % 2 != 0) {
    a.push_back(k);
    for (i = 1; i < k; i++) {
      a.push_back(k - i);
      a.push_back(k + i);
    }
  } else {
    a.push_back(k);
    a.push_back(k + 1);
    for (i = 1; i < k; i++) {
      a.push_back(k - i);
      a.push_back(k + 1 + i);
    }
  }
  k = 0;
  while (n != 0) {
    cout << a[k] << endl;
    if (k + 1 == a.size())
      k = 0;
    else
      k++;
    n--;
  }
}
