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