#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; ll db[35][100005]; int main(){ ll N, K; cin >> N >> K; vector P; rep(i,N){ ll a; cin >> a; P.push_back(a); db[0][i] = a; } rep(i,34){ rep(j,N){ db[i+1][j] = db[i][j] + db[i][(db[i][j]+j)%N]; } } rep(i,N){ int pos = i; for(int j=34; j>=0; j--){ if((K>>j)&1){ pos += db[j][pos%N]; } } cout << pos+1 << endl; } return 0; }