#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;
using lld = long double;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using PII = pair<int, int>;
random_device rnd;
mt19937 mt(rnd());

const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 1e9 + 7;
int main()
{
    int n, m;
    cin >> n >> m;
    VVI v(n, VI(m));
    rep(i, n) rep(j, m)
    {
        cin >> v[i][j];
        v[i][j]--;
    }
    VI p(n, 0);
    int ans = IINF;
    map<int, bool> used;
    rep(j, m)
    {
        map<int, int> mp;
        rep(i, n)
        {
            mp[v[i][p[i]]]++;
        }
        int delid = -1;
        int delnum = 0;
        rep(i, m)
        {
            if (mp[i] > delnum)
            {
                delnum = mp[i];
                delid = i;
            }
        }
        chmin(ans, delnum);
        used[delid] = true;
        if (j == m - 1)
            break;
        rep(i, n)
        {
            while (used[v[i][p[i]]])
                p[i]++;
        }
    }
    cout << ans << endl;
    return 0;
}
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template<class F>auto recursive(F f){return[f](auto...a){return f(f,a...);};}
template<class T>using rev_priority_queue=priority_queue<T,vector<T>,greater<T>>;
template<class T>using vector2d=vector<vector<T>>;
struct fixprec{int p;fixprec(int p):p(p){}};
ostream&operator<<(ostream&o,fixprec f){return o<<fixed<<setprecision(f.p);}

int main() {
    int N, M, lK;
    i64 K;
    cin >> N;
    vector<i64> x(N), dx(N - 1), y(N);
    for(i64 &x_ : x) cin >> x_;
    for(int i = 0; i < N - 1; i++) {
        dx[i] = x[i + 1] - x[i];
    }
    cin >> M >> K;
    vector<int> perm_base(N - 1), perm_ans(N - 1), perm_tmp(N - 1);
    for (int i = 0; i < N - 1; i++) {
        perm_base[i] = perm_ans[i] = i;
    }
    for(int i = 0; i < M; i++) {
        int a;
        cin >> a;
        a--;
        swap(perm_base[a - 1], perm_base[a]);
    }
    // 繰り返し二乗法
    for(int b = 0; (1ll << b) <= K; b++) {
        if (K & (1ll << b)) {
            for (int i = 0; i < N - 1; i++) {
                perm_ans[i] = perm_base[perm_ans[i]];
            }
        }
        for (int i = 0; i < N - 1; i++) perm_tmp[i] = i;
        for (int i = 0; i < N - 1; i++) {
            perm_tmp[i] = perm_base[perm_base[i]];
        }
        swap(perm_tmp, perm_base);
    }
    for(int i = 0; i < N; i++) {
        y[i] = i ? dx[perm_ans[i - 1]] + y[i - 1] : x[0];
        cout << y[i] << endl;
    }
    return 0;
}

