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