#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, mid1, mid2, mid, x, y;
  scanf("%d %d", &n, &m);
  vector<int> v;
  if (m % 2 == 0) {
    mid1 = m / 2;
    mid2 = m / 2 + 1;
    v.push_back(mid1);
    v.push_back(mid2);
    for (int i = 1; i < m / 2; ++i) {
      v.push_back(mid1 - i);
      v.push_back(mid2 + i);
    }
  } else {
    mid = m / 2 + 1;
    v.push_back(mid);
    for (int i = 1; i < mid; ++i) {
      v.push_back(mid - i);
      v.push_back(mid + i);
    }
  }
  x = n / m;
  y = n % m;
  for (int i = 0; i < x; ++i)
    for (int j = 0; j < m; ++j) printf("%d\n", v[j]);
  for (int i = 0; i < y; ++i) printf("%d\n", v[i]);
  return 0;
}
