#include <bits/stdc++.h>
using namespace std;
const int maxx = 100000 + 100;
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    if (m == 1) {
      for (int i = 0; i < n; i++) printf("1\n");
      continue;
    } else if (m == 2) {
      int ans = 1;
      for (int i = 0; i < n; i++) printf("%d\n", (++ans) % 2 == 0 ? 1 : 2);
      continue;
    }
    int mid = 0, l, ans;
    if (m % 2 != 0) {
      mid = (m + 1) / 2;
      printf("%d\n", mid);
      l = 1;
      for (int i = 0; i < n - 1; i++) {
        l *= -1;
        ans = mid + l;
        printf("%d\n", ans);
        if (l > 0) l++;
        if (l == mid) {
          if (i != n - 2) printf("%d\n", mid);
          l = 1;
          i++;
        }
      }
    } else {
      mid = m / 2;
      l = 1;
      int left = mid, right = mid + 1;
      for (int i = 0; i < n; i++) {
        l *= -1;
        if (l == -1) {
          printf("%d\n", left);
          left--;
        } else {
          printf("%d\n", right);
          right++;
        }
        if (right == m + 1) {
          left = mid;
          right = mid + 1;
        }
      }
    }
  }
  return 0;
}
