n,k=map(int,input().split()) p=list(map(int,input().split())) dp=[p]+[[0 for j in range(n)] for i in range(31)] for i in range(1,31): for j in range(n): dp[i][j]=dp[i-1][((j+dp[i-1][j]+1)%n)-1]+dp[i-1][j] ans=[i for i in range(1,n+1)] for i in range(k.bit_length()): if bin(k)[-i-1]=="1": for j in range(n): ans[j]+=dp[i][j] for i in ans: print(i)