#include <bits/stdc++.h>
using namespace std;
int const MAX_N = 100001;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v;
  vector<int> u;
  int t = m;
  for (int i = 0; i < m; i++) {
    v.push_back((i + 1));
  }
  for (int i = 0; i < m; i++) {
    u.push_back(v[(int)((v.size() + 1) / 2) - 1]);
    v.erase(v.begin() + (int)((v.size() + 1) / 2) - 1);
  }
  for (int i = 0; i < n; i++) {
    cout << u[i - m * ((int)i / m)] << endl;
  }
  return 0;
}
