#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     cin >> n >> m;     int mid = (m + 1) / 2;     int cnt = 0;     int ans[m + 1];     if (m % 2) {       int i = 1;       int cnt = 1;       int k = 1;       ans[k++] = mid;       while (true) {         if (cnt > m) break;         ans[k++] = mid - i;         cnt++;         if (cnt > m) break;         ans[k++] = mid + i;         cnt++;         i++;       }     } else {       int i = 1;       int cnt = 0;       int k = 1;       while (true) {         if (cnt > m) break;         ans[k++] = mid - i + 1;         cnt++;         if (cnt > m) break;         ans[k++] = mid + i;         cnt++;         i++;       }     }     int k = 1;     for (int i = (1); i <= (n); i++) {       cout << ans[k++] << endl;       if (k > m) k = 1;     }     return 0;   }   