#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<int> A;
  cin >> n >> m;
  int cnt = 0;
  if (m % 2 == 1) {
    A.push_back((m + 1) / 2);
    cnt++;
    for (int k = 1; (m + 1) / 2 - k > 0; k++) {
      if (cnt == n) break;
      A.push_back((m + 1) / 2 - k);
      cnt++;
      if (cnt == n) break;
      A.push_back((m + 1) / 2 + k);
      cnt++;
      if (cnt == n) break;
    }
    for (int k = 1; k < (n / m); k++) {
      for (int i = 0; i < m; i++) A.push_back(A[i]);
    }
    if (n / m >= 1) {
      for (int i = 0; i < (n % m); i++) A.push_back(A[i]);
    }
  } else {
    A.push_back(m / 2);
    cnt++;
    for (int k = 1; m / 2 - k > 0; k++) {
      if (cnt == n) break;
      A.push_back(m / 2 + k);
      cnt++;
      if (cnt == n) break;
      A.push_back(m / 2 - k);
      cnt++;
      if (cnt == n) break;
    }
    if (cnt < n) {
      A.push_back(m);
      cnt++;
    }
    for (int k = 1; k < (n / m); k++) {
      for (int i = 0; i < m; i++) A.push_back(A[i]);
    }
    if (n / m >= 1) {
      for (int i = 0; i < (n % m); i++) A.push_back(A[i]);
    }
  }
  for (int i = 0; i < A.size(); i++) cout << A[i] << endl;
  return 0;
}
