#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int v[100009];
  int p = (m + 1) / 2 - 1, q = (m + 1) / 2 + 1;
  for (int i = 2; i <= m; i += 2) {
    if (m % 2 == 1) {
      v[i] = p;
      v[i + 1] = q;
    } else {
      v[i + 1] = p;
      v[i] = q;
    }
    p--;
    q++;
  }
  v[1] = (m + 1) / 2;
  v[0] = v[m];
  for (int i = 1; i <= n; i++) {
    cout << v[i % m] << endl;
  }
  return 0;
}
