n, k = map(int, input().split()) P = list(map(int, input().split())) L = 32 D = [[0]*n for _ in range(L+1)] for i, p in enumerate(P): D[0][i] = p for i in range(L): for j in range(n): D[i+1][j] = D[i][j]+D[i][(j+D[i][j])%n] for i in range(n): ans = i for bit in range(L): if k & (1 << bit): ans += D[bit][ans%n] print(ans+1)