#include <bits/stdc++.h>
using namespace std;
map<int, int> a;
int main() {
  int n, m;
  cin >> n >> m;
  if (m % 2 == 0) {
    int s = m / 2 - 1;
    int e = m / 2;
    bool sOccupied = false;
    for (int i = 0; i < n; i++) {
      if (sOccupied) {
        a[i] = e;
        s--;
        e++;
        sOccupied = false;
      } else {
        a[i] = s;
        sOccupied = true;
      }
      if (s < 0) {
        s = m / 2 - 1;
        e = m / 2;
      }
    }
  } else {
    int s = m / 2;
    int e = m / 2;
    bool sOccupied = false;
    for (int i = 0; i < n; i++) {
      if (s == e) {
        a[i] = s;
        s--;
        e++;
      } else {
        if (sOccupied) {
          a[i] = e;
          s--;
          e++;
          sOccupied = false;
        } else {
          a[i] = s;
          sOccupied = true;
        }
      }
      if (s < 0) {
        s = e = m / 2;
      }
    }
  }
  for (map<int, int>::iterator it = a.begin(); it != a.end(); it++) {
    printf("%d\n", it->second + 1);
  }
  return 0;
}
