#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
double startTime;
double gct() { return ((double)clock() - startTime) / CLOCKS_PER_SEC; }
void suraj() {
  int n, m;
  cin >> n >> m;
  vector<int> ans;
  if (m % 2 == 1) {
    int ref = m / 2;
    int ptr = 1;
    ans.push_back(ref);
    while (ptr <= ref) {
      ans.push_back(ref - ptr);
      ans.push_back(ref + ptr);
      ptr++;
    }
  } else {
    int ref = m / 2 - 1;
    int ptr = 1;
    ans.push_back(ref);
    while (ptr <= ref) {
      ans.push_back(ref + ptr);
      ans.push_back(ref - ptr);
      ptr++;
    }
    ans.push_back(ref + ptr);
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i % m] + 1 << "\n";
  }
}
void suraj2() {}
int main() {
  startTime = (double)clock();
  suraj();
  return 0;
}
