#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-10;
int in() {
  int r = 0, c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') return -in();
  for (; c > 32; r = (r << 1) + (r << 3) + c - '0', c = getchar())
    ;
  return r;
}
int bask[101000];
void solve() {
  int n, m;
  cin >> n >> m;
  int i;
  int pos = m / 2;
  int iter = 0;
  if (m % 2 == 1)
    bask[pos] = iter++;
  else {
    bask[pos] = iter++;
    bask[pos + 1] = iter++;
  }
  pos--;
  while (pos >= 0) {
    bask[pos] = iter++;
    bask[m - 1 - pos] = iter++;
    pos--;
  }
  vector<pair<int, int> > ans;
  iter = 0;
  for (i = 0; i < m; i++) ans.push_back(pair<int, int>(bask[i], i + 1));
  sort(ans.begin(), ans.end());
  for (i = 0; i < n; i++) {
    printf("%d\n", ans[i % m].second);
  }
}
int main() {
  solve();
  return 0;
}
