#include <bits/stdc++.h>
using namespace std;
int n, m;
bool a = true;
int main() {
  scanf("%d%d", &n, &m);
  int arr[m];
  if (m % 2 == 0) {
    arr[0] = (m) / 2;
    for (int i = 1; i < m; i++) {
      if (!a) {
        arr[i] = arr[i - 1] - i;
        a = !a;
      } else {
        arr[i] = arr[i - 1] + i;
        a = !a;
      }
    }
  } else {
    arr[0] = (m + 1) / 2;
    for (int i = 1; i < m; i++) {
      if (!a) {
        arr[i] = arr[i - 1] + i;
        a = !a;
      } else {
        arr[i] = arr[i - 1] - i;
        a = !a;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d\n", arr[i % m]);
  }
  return 0;
}
