#include <bits/stdc++.h>
using namespace std;
long arr[100005];
int main() {
  long a, b, c, d, e, f, i, j, k, hi, lo, l, m, n, t, count, mid, high, low;
  while (scanf("%ld %ld", &a, &b) != EOF) {
    c = 1;
    if (b % 2 == 0) {
      for (i = 1; i <= a; i++) {
        if (c == 1) {
          printf("%ld\n", b / 2);
          arr[c] = b / 2;
        } else if (c == 2) {
          printf("%ld\n", b / 2 + 1);
          arr[c] = b / 2 + 1;
        } else {
          if (c % 2 != 0) {
            printf("%ld\n", arr[c - 2] - 1);
            arr[c] = arr[c - 2] - 1;
          } else {
            printf("%ld\n", arr[c - 2] + 1);
            arr[c] = arr[c - 2] + 1;
          }
        }
        c++;
        if (c > b) c = 1;
      }
    } else {
      c = 1;
      for (i = 1; i <= a; i++) {
        if (c == 1) {
          printf("%ld\n", b / 2 + 1);
          arr[c] = b / 2 + 1;
        } else if (c == 2) {
          printf("%ld\n", arr[c - 1] - 1);
          arr[c] = arr[c - 1] - 1;
        } else if (c == 3) {
          printf("%ld\n", arr[c - 2] + 1);
          arr[c] = arr[c - 2] + 1;
        } else {
          if (c % 2 == 0) {
            printf("%ld\n", arr[c - 2] - 1);
            arr[c] = arr[c - 2] - 1;
          } else {
            printf("%ld\n", arr[c - 2] + 1);
            arr[c] = arr[c - 2] + 1;
          }
        }
        c++;
        if (c > b) c = 1;
      }
    }
  }
  return 0;
}
