#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int pos = (m + 1) / 2, pos2 = (m + 1) / 2 + 1;
  bool f = 0;
  while (n--) {
    if (m == 1) {
      cout << 1 << '\n';
      continue;
    }
    if (f) {
      cout << pos2++ << '\n';
      if (pos2 == m + 1) pos2 = (m + 1) / 2 + 1;
    } else {
      if (m % 2 and pos == (m + 1) / 2) f = 1 - f;
      cout << pos-- << '\n';
      if (pos == 0) pos = (m + 1) / 2;
    }
    f = 1 - f;
  }
  return 0;
}
