#include <bits/stdc++.h>
#define maxn 100010
#define ll long long
using namespace std;

int n,m,vis[maxn];

ll ans[maxn],a[maxn],k,cnt,q[maxn],pos[maxn];

template <class T>
void read(T &x){
	char s=getchar();int f=0;x=0;
	while(s<'0'||s>'9'){if(s=='-') f=1;s=getchar();}
	while(s>='0'&&s<='9') x=(x<<3)+(x<<1)+s-'0',s=getchar();
	x=f?-x:x;
}

int main(){
	read(n);
	for(int i=1;i<=n;i++){
		read(a[i]);
		pos[i]=1ll*i;
	}
	read(m);read(k);
	for(int i=n;i>=1;i--) a[i]=a[i]-a[i-1];
	for(int i=1,x;i<=m;i++){
		read(x);
		swap(pos[x],pos[x+1]);
	}
	for(int i=1;i<=n;i++){
		ll p=i;cnt=0;
		if(vis[i]) continue;
		q[++cnt]=p;
		vis[p]=1;
		p=pos[p];
		while(p!=i){
			q[++cnt]=p;
			vis[p]=1;
			p=pos[p];
		}
		for(int j=1;j<=cnt;j++) ans[q[j]]=a[q[(j+k-1)%cnt+1]];
	}
	for(int i=1;i<=n;i++){
		ans[i]+=ans[i-1];
		printf("%lld.0\n",ans[i]);
	}
	return 0;
}
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
typedef long long ll;
using namespace std;
const int N = 2e5 + 5;
using namespace std;

int main()
{
    int n, q;
    cin >> n >> q;
    string s;
    cin >> s;
    int a[N];
    a[0] = 1;
    for (int i = 1; i < n; ++i)
    {
        if (s[i] == 'C' && s[i - 1] == 'A')
        {
            a[i] = a[i - 1] + 1;
        }
        else
        {
            a[i] = a[i - 1];
        }
    }
    int l, r;
    rep(i, q)
    {
        cin >> l >> r;
        cout << a[r - 1] - a[l - 1] << endl;
    }
    return 0;
}