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