#include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; vector> p(30, vector(n)); for (int i = 0; i < n; i++) { cin >> p[0][i]; } for (int j = 0; j < 30 - 1; j++) { for (int i = 0; i < n; i++) { ll t = p[j][i]; p[j + 1][i] = t + p[j][(i + t) % n]; } } for (int i = 0; i < n; i++) { ll s = i; for (int j = 30 - 1; j >= 0; j--) { if (k & 1 << j) s += p[j][s % n]; } cout << s + 1 << '\n'; } return 0; }