using System; using static System.Console; using System.Linq; using System.Collections.Generic; using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.Intrinsics.X86; using System.Runtime.Intrinsics.Arm; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (n, k) = (c[0], c[1]); var p = NList; var dic = new List(); { var next = new long[n]; for (var i = 0; i < n; ++i) next[i] = p[i]; dic.Add(next); } for (var i = 0; i < 32; ++i) { var prev = dic[^1]; var next = new long[n]; for (var j = 0; j < n; ++j) { next[j] = prev[j] + prev[(j + prev[j]) % n]; } dic.Add(next); } var ans = new long[n]; for (var i = 0; i < n; ++i) { var cur = (long)i; var tmp = k; for (var j = 0; j < dic.Count; ++j) { if (tmp % 2 == 1) { cur += dic[j][cur % n]; } tmp >>= 1; } ans[i] = cur + 1; } WriteLine(string.Join("\n", ans)); } }