#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, m;
  cin >> n >> m;
  vector<int> p;
  if (m & 1) {
    p.push_back((m + 1) / 2);
  }
  int mid = m / 2;
  for (int i = m / 2; i > 0; i--) {
    p.push_back(i);
    p.push_back(m - i + 1);
  }
  for (int i = 0; i < n; i++) {
    cout << p[i % m] << "\n";
  }
  return 0;
}
