#include <bits/stdc++.h>
using namespace std;
const int MAXN = +100500;
const int INF = 1e18;
int main() {
  long long n, m;
  cin >> n >> m;
  long long mid = (m + 1) / 2;
  vector<long long> ans;
  long long l = mid - 1;
  long long r = mid + 1;
  if (m % 2 == 1) {
    ans.push_back(mid);
    while (l >= 1 || r <= m) {
      if (l >= 1) {
        ans.push_back(l);
        l--;
      }
      if (r <= m) {
        ans.push_back(r);
        r++;
      }
    }
  } else {
    l++;
    while (l >= 1 || r <= m) {
      if (l >= 1) {
        ans.push_back(l);
        l--;
      }
      if (r <= m) {
        ans.push_back(r);
        r++;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i % m] << endl;
  }
}
