#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
const long long inf = 9e18 + 9;
const long long mod = 1e9 + 7;
vector<long long> a;
void solve() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    if ((m + (i % m)) % 2) {
      cout << (m + (i) % m + 1) / 2 << "\n";
    } else {
      cout << (m - (i % m)) / 2 << "\n";
    }
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    solve();
  }
}
