#include <bits/stdc++.h>
using namespace std;
void fastInOut();
int main() {
  fastInOut();
  int n, m;
  scanf("%d%d", &n, &m);
  int k = ((m + 1) / 2) - 1, c = (m + 1) / 2;
  int h = 0;
  if (m & 1) {
    for (int i = 0;; i++) {
      if (h == n) break;
      if (k == 0 && c == m + 1) k = ((m + 1) / 2) - 1, c = (m + 1) / 2;
      if (c != m + 1) {
        printf("%d\n", c++);
        h++;
      }
      if (h == n) break;
      if (k != 0) {
        printf("%d\n", k--);
        h++;
      }
    }
  } else {
    int k = ((m + 1) / 2), c = (m + 1) / 2;
    c++;
    for (int i = 0;; i++) {
      if (h == n) break;
      if (k == 0 && c == m + 1) k = ((m + 1) / 2), c = ((m + 1) / 2) + 1;
      if (k != 0) {
        printf("%d\n", k--);
        h++;
      }
      if (h == n) break;
      if (c != m + 1) {
        printf("%d\n", c++);
        h++;
      }
    }
  }
}
void fastInOut() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
}
