#include <bits/stdc++.h>
const long long int mod = 1000000007;
const long long int INF = 1000000000000000000;
using namespace std;
unsigned long long int prime(unsigned long long int n) {
  if (n <= 1) return 0;
  if (n <= 3) return 1;
  if (n % 2 == 0 || n % 3 == 0) return 0;
  for (unsigned long long int i = 5; i * i <= n; i += 6)
    if (n % (i) == 0 || n % (i + 2) == 0) return 0;
  return 1;
}
int main() {
  long long int n, m;
  cin >> n >> m;
  if (m == 1) {
    for (int i = 0; i < n; i++) {
      cout << 1 << endl;
    }
    return 0;
  }
  if (m == 2) {
    int c = 0;
    while (n--) {
      if (c == 0) {
        cout << 1 << endl;
        c = 1;
      } else {
        cout << 2 << endl;
        c = 0;
      }
    }
    return 0;
  }
  if (m % 2 == 0) {
    long long int a = m / 2, s = m / 2 + 1, c = 0;
    while (n--) {
      if (c == 0) {
        cout << a << endl;
        c = 1;
        a--;
      } else {
        cout << s << endl;
        c = 0;
        s++;
      }
      if (a == 0) {
        a = m / 2;
      }
      if (s == m + 1) {
        s = m / 2 + 1;
      }
    }
  } else {
    long long int a = m / 2, c = 0;
    long long int s = m / 2 + 1;
    while (n--) {
      if (s == m / 2 + 1) {
        cout << s << endl;
        s++;
        c = 0;
      } else {
        if (c == 0) {
          cout << a << endl;
          c = 1;
          a -= 1;
        } else {
          cout << s << endl;
          c = 0;
          s += 1;
        }
        if (s == m + 1) {
          s = m / 2 + 1;
        }
        if (a == 0) {
          a = m / 2;
        }
      }
    }
  }
  return 0;
}
