#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
#define m_k make_pair
#define int long long
using namespace std;
const int N=1e5+100;
int n,m,k,a[N],b[N],f[N],c[N];
int fa[N][64],sum[N];
signed main()
{
	scanf("%lld",&n);
	for (int i=1;i<=n;i++) scanf("%lld",&f[i]);
	scanf("%lld%lld",&m,&k);
	for (int i=1;i<=m;i++) scanf("%lld",&a[i]);
	for (int i=1;i<=n;i++) b[i]=i;
	for (int i=1;i<=m;i++) swap(b[a[i]],b[a[i]+1]);
	for (int i=1;i<=n;i++) fa[i][0]=b[i];
	for (int j=1;j<=62;j++)
	{
		for (int i=1;i<=n;i++) fa[i][j]=fa[fa[i][j-1]][j-1];
	}
	for (int i=1;i<=n;i++)
	{
		int cnt=k,x=i;
		for (int j=62;j>=0;j--)
		{
			if (cnt>=(1ll<<j))
			{
				cnt-=(1ll<<j);
				x=fa[x][j];
			}
		}
		if (x==1) c[i]=f[x];
		else c[i]=f[x]-f[x-1];
	}
	for (int i=1;i<=n;i++) sum[i]=sum[i-1]+c[i];
	for (int i=1;i<=n;i++)
	{
		double ans=sum[i];
		printf("%.12lf\n",ans);
	}
}
#include <bits/stdc++.h>
#define fi first
#define se second
#define ii pair<int, int>
#define int long long
using namespace std;

const int INF = 1e9;
int n, m;
int ans = INF;
int a[85][85], b[85][85];
bool f[85][85][52000];

void attempt(int i, int j, int diff)
{

    if (i == n && j == m)
    {
        ans = min(ans, abs(diff + a[i][j] - b[i][j]));
        ans = min(ans, abs(diff - a[i][j] + b[i][j]));
        return;
    }
    if (f[i][j][diff])
        return;
    f[i][j][diff] = 1;

    if (i < n){
        attempt(i+1, j, abs(diff + a[i][j] - b[i][j]));
        attempt(i+1, j, abs(diff - a[i][j] + b[i][j]));
    }
    if (j < m){
        attempt(i, j+1, abs(diff + a[i][j] - b[i][j]));
        attempt(i, j+1, abs(diff - a[i][j] + b[i][j]));
    }

}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

//    freopen("in.inp", "r", stdin);
//    freopen("out.out", "w", stdout);

    cin >> n >> m;

    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= m; j++)
            cin >> a[i][j];

    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= m; j++)
            cin >> b[i][j];

    attempt(1, 1, 0);
    cout << ans;
}
