n,k,*A = map(int,open(0).read().split()) *X, = range(n) while k: if k&1: X = [x+A[x%n] for x in X] A = [A[i]+A[(i+A[i])%n] for i in range(n)] k //= 2 print(*[x+1 for x in X],sep="\n")