#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
int main() {
  int n, m, k, i = 0, k1, k2;
  scanf("%d %d", &n, &m);
  k = (m + 1) / 2;
  for (int j = 1; j < n + 1; j++) {
    i = (j - 1) % m + 1;
    if (m % 2 == 0) {
      if (i == 1) {
        k = (m + 1) / 2;
        k1 = k;
        k2 = k;
      } else if (i % 2 == 0) {
        k1++;
        k = k1;
      } else {
        k2--;
        k = k2;
      }
    } else {
      if (i == 1) {
        k = (m + 1) / 2;
        k1 = k;
        k2 = k;
      } else if (i % 2 == 0) {
        k1--;
        k = k1;
      } else {
        k2++;
        k = k2;
      }
    }
    printf("%d\n", k);
  }
}
