#include<iostream> #include<cstdio> #include<cctype> #define maxn 1000010 #define gc getchar #define ll long long usingnamespacestd;
ll read(){ ll x = 0; char c = gc(); while (!isdigit(c)) c = gc(); while (isdigit(c)) x = x * 10 + c - '0', c = gc(); return x; }
int n, k; ll m;
ll a[maxn];
int st[maxn][2];
int ans[maxn]; intmain(){ n = read(); k = read(); m = read(); for (int i = 1; i <= n; ++i) a[i] = read(); int l = 1, r = k + 1; for (int i = 1; i <= n; ++i) { while (r < n && a[r + 1] - a[i] < a[i] - a[l]) ++l, ++r; st[i][0] = a[r] - a[i] > a[i] - a[l] ? r : l; } for (int i = 1; i <= n; ++i) if (m & 1) ans[i] = st[i][0]; else ans[i] = i; for (int j = 1; j < 32; ++j) { int t1 = j & 1, t2 = t1 ^ 1; for (int i = 1; i <= n; ++i) st[i][t1] = st[st[i][t2]][t2]; for (int i = 1; i <= n; ++i) if (m >> j & 1) ans[i] = st[ans[i]][t1]; } for (int i = 1; i <= n; ++i) printf("%d ", ans[i]); return0; }