#include <bits/stdc++.h>
using namespace std;
int n, m, f[100001];
long long a[100001];
void OC() {
  int l = (m + 1) / 2 - 1;
  int r = (m + 1) / 2;
  for (int i = 1; i <= m; ++i)
    if (i % 2 == 1) {
      f[i] = r;
      r++;
    } else {
      f[i] = l;
      l--;
    }
  if (f[m] != m) f[m] = m;
}
void EC() {
  int l = (m + 1) / 2;
  int r = (m + 1) / 2 + 1;
  for (int i = 1; i <= m; ++i)
    if (i % 2 == 1) {
      f[i] = l;
      l--;
    } else {
      f[i] = r;
      r++;
    }
  if (f[m] != m) f[m] = m;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  if (m % 2 == 1)
    OC();
  else
    EC();
  for (int i = 1; i <= n; ++i)
    if (i % m == 0)
      cout << f[m] << '\n';
    else
      cout << f[i % m] << '\n';
  return 0;
}
