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