#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:200000000")
const double EPS = 1E-9;
const int INF = 1000000000;
const long long INF64 = (long long)1E18;
const double PI = 3.1415926535897932384626433832795;
pair<int, int> a[110000];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (int)(m); i++)
    a[i] = make_pair(abs((m + 1) - (i + 1) * 2), i);
  sort(a, a + m);
  for (int i = 0; i < (int)(n); i++) printf("%d\n", a[i % m].second + 1);
  return 0;
}
