#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     while (cin >> n >> m) {       int tmp = 0, mid = (m + 1) / 2, res = mid;       while (n--) {         if (tmp % 2 == m % 2)           res -= tmp;         else           res += tmp;         if (tmp == m) tmp = 0, res = mid;         cout << res << endl;         tmp++;       }     }     return 0;   }   