#include <bits/stdc++.h>
using namespace std;
int n, m;
double t;
struct node {
  int num, idx;
  node() { num = idx = 0; }
  node(int a, int c) { num = a, idx = c; }
  bool operator<(const node& x) const {
    if (num != x.num) return num > x.num;
    double d1 = fabs(t - (double)idx);
    double d2 = fabs(t - (double)x.idx);
    if (fabs(d1 - d2) > 1e-9) return d1 > d2;
    return idx > x.idx;
  }
};
priority_queue<node> q;
int main() {
  scanf("%d%d", &n, &m);
  t = m + 1;
  t /= 2;
  for (int i = 0; i < m; ++i) {
    q.push(node(0, i + 1));
  }
  for (int i = 0; i < n; ++i) {
    int x = q.top().num;
    int y = q.top().idx;
    q.pop();
    printf("%d\n", y);
    q.push(node(x + 1, y));
  }
  return 0;
}
