#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int t = m / 2 + 1;
  if (m % 2 == 1) {
    int w = t, i = 0, j = -1, c = 1;
    while (n > 0) {
      if (w == 0) {
        w = t;
        i = 0;
        c = 1;
      }
      cout << w << endl;
      ++i;
      --n;
      c *= j;
      w += i * c;
    }
  } else {
    int w = t - 1, i = 0, j = -1, c = -1;
    while (n > 0) {
      if (w == 0) {
        w = t - 1;
        i = 0;
        c = -1;
      }
      cout << w << endl;
      ++i;
      --n;
      c *= j;
      w += i * c;
    }
  }
}
