#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int middle = (m + 1) >> 1;
  vector<int> ar;
  ar.push_back(middle);
  for (int i = 1; i < n; ++i) {
    if (m & 1) {
      if (middle - i != 0) ar.push_back(middle - i);
      ar.push_back(middle + i);
    } else {
      ar.push_back(middle + i);
      if (middle - i != 0) ar.push_back(middle - i);
    }
  }
  for (int i = 0; i < n; ++i) cout << ar[i % m] << '\n';
  return 0;
}
