#include #include #define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) using namespace std; using namespace atcoder; typedef long long ll; ll f(ll n, ll x, ll t, char c) { t %= n * 2; if (t >= n) { c ^= 'A'; c ^= 'B'; x = n - x; t -= n; } if (c == 'B') { if (x + t <= n) { return x + t; } else { ll mi = x + t - n; return n - mi; } } else { return abs(x - t); } } int main() { ll n, k, t; cin >> n >> k >> t; vector a(n); vector b(n); rep(i, 0, n) cin >> a[i]; rep(i, 0, n) cin >> b[i]; vector bsort = b; sort(bsort.begin(), bsort.end()); vector anssort(n); rep(i, 0, n) { anssort[i] = f(k, b[i], t, a[i]); } sort(anssort.begin(), anssort.end()); map mp; rep(i, 0, n) mp[bsort[i]] = anssort[i]; rep(i, 0, n) cout << mp[b[i]] << ' '; }