#include using namespace std; using lint = long long; const lint inf = 1LL << 60; const lint mod = 1000000007; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); lint n, k; cin >> n >> k; vector p(n); for (int i = 0; i < n; ++i) { cin >> p[i]; } vector> dbl(n, vector(35, 0)); for (int i = 0; i < n; ++i) { dbl[i][0] = p[i]; } for (int i = 1; i < 35; ++i) { for (int j = 0; j < n; ++j) { dbl[j][i] = dbl[j][i - 1] + dbl[(j + dbl[j][i - 1]) % n][i - 1]; } } for (int i = 0; i < n; ++i) { lint curr = i; for (int j = 0; j < 35; ++j) { if (1LL << j & k) { curr += dbl[curr % n][j]; } } cout << curr + 1 << "\n"; } return 0; }