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