#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int mid = (m + 1) / 2, i = 1, f = 0;
  if (m % 2 == 1) {
    while (n--) {
      cout << mid << "\n";
      if (!f) {
        mid -= i;
        f = 1;
      } else {
        mid += i;
        f = 0;
      }
      i++;
      if (mid < 1 || mid > m) {
        mid = (m + 1) / 2;
        i = 1;
        f = (!f);
      }
    }
    return 0;
  }
  int l = m / 2, r = m / 2 + 1, j = 0;
  i = 0;
  while (n) {
    cout << l - i << "\n";
    n--;
    if (n <= 0) break;
    cout << r + j << "\n";
    n--;
    i++, j++;
    if (l - i < 1) i = 0;
    if (r + j > m) j = 0;
  }
  return 0;
}
