#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, mid, c;
  cin >> n >> m;
  if (m == 1) {
    for (int i = 0; i < n; i++) cout << 1 << " ";
  } else if (m == 2) {
    c = 0;
    for (int i = 1; i > 0; i++) {
      if (c < n) {
        cout << 1 << " ";
        c++;
      } else
        break;
      if (c < n) {
        cout << 2 << " ";
        c++;
      } else
        break;
    }
  } else {
    mid = (m + 1) / 2;
    cout << mid << " ";
    c = 1;
    if (m - mid <= mid - 1) {
      for (int i = 1; i > 0; i++) {
        if ((c + 1) % m == 0 && c < n) {
          cout << m << " ";
          c++;
        }
        if (c < n) {
          cout << mid - (i % mid) << " ";
          c++;
        } else
          break;
        if (c < n) {
          if (i % mid != 0) {
            cout << mid + (i % mid) << " ";
            c++;
          }
        } else
          break;
      }
    } else {
      for (int i = 1; i > 0; i++) {
        if ((c + 1) % m == 0 && c < n) {
          cout << m << " ";
          c++;
        }
        if (c < n) {
          if ((c + 1) % m == 0)
            cout << m << " ";
          else
            cout << mid + (i % mid) << " ";
          c++;
        } else
          break;
        if (c < n) {
          if (i % mid != 0) {
            cout << mid - (i % mid) << " ";
            c++;
          }
        } else
          break;
      }
    }
  }
  return 0;
}
