#include <bits/stdc++.h>
using namespace std;
const double EPS = 1E-9;
int n, m;
vector<int> v;
int main() {
  cin >> n >> m;
  bool order = true;
  int id = (m + 1) / 2, left, right;
  left = id - 1, right = id + 1;
  v.push_back(id);
  if (m % 2 == 0) order = false;
  while (true) {
    if (m % 2 == 1 && !left && right == m + 1) break;
    if (m % 2 == 0 && right == m + 1) break;
    if (order)
      id = left--, order = false;
    else
      id = right++, order = true;
    v.push_back(id);
  }
  if (m == n)
    for (int i = 0; i < v.size(); i++) cout << v[i] << "\n";
  else if (m > n) {
    for (int i = 0; i < n; i++) cout << v[i] << endl;
  } else {
    for (int z = 0; z < n / m; z++)
      for (int i = 0; i < v.size(); i++) cout << v[i] << "\n";
    for (int z = 0; z < n % m; z++) cout << v[z] << "\n";
  }
  return 0;
}
