#include <bits/stdc++.h>   using namespace std;   struct prog {     int i;     int cmp;   } a[100005];   int ans[100005];   bool cmp(prog a, prog b) {     if (a.cmp == b.cmp)       return a.i < b.i;     else       return a.cmp < b.cmp;   }   int main() {     int n, m;     while (cin >> n >> m) {       priority_queue<prog> q;       int i, j;       for (i = 0; i < m; i++) {         a[i].i = i + 1;         a[i].cmp = (int)fabs((m + 1) / 2.0 - i - 1);       }       sort(a, a + m, cmp);       for (i = 0; i < n; i++) {         int k = i % m;         cout << a[k].i << endl;       }     }     return 0;   }   