def doubling(max_size, n): log_size = max_size.bit_length() double = [[-1] * n for i in range(log_size)] # ダブリングで2^0回(= 1回)たどって到達する値を求める for i in range(n): double[0][i] = p[i] # ダブリングで2^k回たどって到達する値を求める for k in range(1, log_size): for i in range(n): double[k][i] = double[k - 1][(double[k - 1][i] + i) % n] + double[k - 1][i] return double n, k = map(int, input().split()) p = list(map(int, input().split())) double = doubling(k + 10, n) for i in range(n): ans = i for kk in range((k + 10).bit_length()): if (k >> kk) & 1: ans += double[kk][ans % n] print(ans + 1)