stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

using vll = vector<ll>;

#define all(x) (x).begin(),(x).end()

template <typename T>

std::ostream& operator<<(std::ostream&s,const vector<T>&xs){

    s<<'[';for(size_t i=0;i<xs.size();++i){if(i)s<<' ';s<<xs[i];}return s<<']';

}



vll permmult(const vll& P, const vll& Q){

    ll n=P.size();

    vll PQ(n);

    for(ll i=0;i<n;++i)PQ[i]=Q[P[i]];

    return PQ;

}



vll permpow(vll P, ll k){

    ll n=P.size();

    vll result(n);

    iota(all(result),0);

    for(;k;k/=2){

        if(k%2)result=permmult(result,P);

        P=permmult(P,P);

    }

    return result;

}



vll permpow2(const vll& P, ll k) {

    ll n=P.size();

    vll Q(n);

    vll done(n);

    vll cycle;

    for(ll i=0;i<n;++i)if(!done[i]){

        done[i]=true;

        cycle.clear();

        cycle.push_back(i);

        for(ll j=P[i];j!=i;j=P[j]){

            cycle.push_back(j);

            done[j]=true;

        }

        ll m=cycle.size();

        for(ll j=0;j<m;++j)Q[P[cycle[j]]] = cycle[(j+k+1)%m];

    }

    return Q;

}



vll perminv(const vll& P) {

    ll n=P.size();

    vll Q(n);

    for(ll i=0;i<n;++i)Q[P[i]]=i;

    return Q;

}



int main() {

    ios::sync_with_stdio(false);



    if (0) {

        //vll perm{0,1, 3,2,  5,6,4,  10,7,8,9};

        vll perm{4,1,2,0,3};

        for(ll i=1;i<10;++i){

            cout<<"i="<<i<<", "<<permpow(perm,i)<<" "<<permpow2(perm,i)<<'\n';

        }

        return 0;

    }



    ll N;cin>>N;

    vll xs(N);for(ll&x:xs)cin>>x;

    ll M,K;cin>>M>>K;

    vll P(N-1);iota(all(P),0);

    for(int i=0,a;i<M&&cin>>a;++i)swap(P[a-2],P[a-1]);

    //P=permpow2(P,K);

    P=permpow(P,K);

    //P=perminv(P);

    vll ds(N-1);

    for(ll i=1;i<N;++i)ds[i-1]=xs[i]-xs[i-1];

    cout<<xs[0]<<".0\n";

    for(ll x=xs[0],i=0;i+1<N;++i){

        x+=ds[P[i]];

        cout<<x<<".0\n";

    }

}


// Faster C++ solution for the same problem (measured speedup: 5.300095539946243x):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN = 100000;

typedef long long ll;

int N, M; ll K;

int x[MAXN + 5];

int a[MAXN + 5], b[MAXN + 5], res[MAXN + 5];

void Pow(ll p) {

	for(int i=1;i<N;i++)

		res[i] = i;

	while( p ) {

		if( p & 1 ) {

			for(int i=1;i<N;i++)

				res[i] = a[res[i]];

		}

		p >>= 1;

		for(int i=1;i<N;i++)

			b[i] = a[a[i]];

		for(int i=1;i<N;i++)

			a[i] = b[i];

	}

}

int main() {

	scanf("%d", &N);

	for(int i=0;i<N;i++)

		scanf("%d", &x[i]);

	for(int i=N-1;i>0;i--)

		x[i] = x[i] - x[i-1];

	scanf("%d%lld", &M, &K);

	for(int i=1;i<N;i++)

		a[i] = i;

	for(int i=1;i<=M;i++) {

		int k;

		scanf("%d", &k);

		swap(a[k-1], a[k]);

	}

	Pow(K);

	ll nw = x[0];

	printf("%lld\n", nw);

	for(int i=1;i<N;i++) {

		nw = nw + x[res[i]];

		printf("%lld\n", nw);

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int N=1e5+10;

typedef long long ll;

int gi() {

    int x=0,o=1;char ch=getchar();

    while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();

    if(ch=='-') o=-1,ch=getchar();

    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();

    return x*o;

}

int n,m,id[N],st[N],top=0;

ll a[N],ans[N],k;

bool vis[N];

int main() {

	//freopen("rabbit.in","r",stdin);

	//freopen("rabbit.out","w",stdout);

    cin>>n;

    for(int i=1;i<=n;i++) a[i]=gi(),id[i]=i;

    for(int i=n;i;i--) a[i]-=a[i-1];

    cin>>m>>k;

    for(int i=1,x;i<=m;i++) x=gi(),swap(id[x],id[x+1]);

    for(int i=1;i<=n;i++)

        if(!vis[i]) {

            top=0;

            for(int j=i;!vis[j];j=id[j]) st[++top]=j,vis[j]=1;

            for(int j=1;j<=top;j++) ans[st[j]]=a[st[(k+j-1)%top+1]];

        }

    for(int i=1;i<=n;i++) ans[i]+=ans[i-1],printf("%lld\n",ans[i]);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.156449600640696x):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN = 100000;

typedef long long ll;

int N, M; ll K;

int x[MAXN + 5];

int a[MAXN + 5], b[MAXN + 5], res[MAXN + 5];

void Pow(ll p) {

	for(int i=1;i<N;i++)

		res[i] = i;

	while( p ) {

		if( p & 1 ) {

			for(int i=1;i<N;i++)

				res[i] = a[res[i]];

		}

		p >>= 1;

		for(int i=1;i<N;i++)

			b[i] = a[a[i]];

		for(int i=1;i<N;i++)

			a[i] = b[i];

	}

}

int main() {

	scanf("%d", &N);

	for(int i=0;i<N;i++)

		scanf("%d", &x[i]);

	for(int i=N-1;i>0;i--)

		x[i] = x[i] - x[i-1];

	scanf("%d%lld", &M, &K);

	for(int i=1;i<N;i++)

		a[i] = i;

	for(int i=1;i<=M;i++) {

		int k;

		scanf("%d", &k);

		swap(a[k-1], a[k]);

	}

	Pow(K);

	ll nw = x[0];

	printf("%lld\n", nw);

	for(int i=1;i<N;i++) {

		nw = nw + x[res[i]];

		printf("%lld\n", nw);

	}

}
// Slower C++ solution:
// LNU_Algotesters

#include <iostream>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cctype>

#include <cstring>

#include <vector>

#include <list>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <algorithm>

#include <iterator>

#include <bitset>

#include <ctime>

#include <fstream>

#include <complex>



using namespace std;



#define FOR(i,a,b) for (int i = (a); i < (b); i++)

#define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)

#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a,value) memset(a, value, sizeof(a))



#define SZ(a) (int)a.size()

#define ALL(a) a.begin(), a.end()

#define PB push_back

#define MP make_pair



typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL) INF;

const int MAX = 100 * 1000 + 47;



int X[MAX];



VI mult(VI &A, VI &B)

{

    VI res(SZ(A));

    FOR(i, 0, SZ(A))

        res[i] = B[A[i]];

    return res;

};





VI BP(VI& P, LL n)

{

    VI res;

    FOR(i, 0, SZ(P))res.PB(i);

    while(n)

    {

        if (n & 1)res = mult(res, P);

        P = mult(P, P);

        n >>= 1;

    }

    return res;

}



int main()

{

    int n;

    scanf("%d", &n);

    FOR(i, 0, n)scanf("%d", X + i);

    int m;

    LL k;

    scanf("%d%lld", &m, &k);

    VI P;

    FOR(i, 0, n-1)

        P.PB(i);

    FOR(i, 0, m)

    {

        int x;

        scanf("%d", &x);

        --x;

        swap(P[x], P[x-1]);

    }

    //cout << m << endl << endl;

    P = BP(P, k);

    LL cur = X[0];

    FOR(i, 0, n)

    {

        printf("%lld\n", cur);

        if (i < SZ(P))cur += X[P[i] + 1] - X[P[i]];

    }

}




// Faster C++ solution for the same problem (measured speedup: 5.168920926917815x):
#include<cstdio>

#include<algorithm>

#include<cstring>

#define MN 100005

using namespace std;

int n,m,c[MN],tmp[MN];

long long a[MN],v[MN],k,ans[MN],sum;

bool vis[MN];

int main(){

	scanf("%d",&n);int x;

	for(int i=1;i<=n;i++){

		scanf("%lld",&a[i]);

		v[i]=a[i]-a[i-1],c[i]=i;

	}scanf("%d%lld",&m,&k);

	for(int i=1;i<=m;i++)scanf("%d",&x),swap(c[x],c[x+1]);

	for(int i=1,j,tt=0;i<=n;i++,tt=0)if(!vis[i]){

		for(j=i;!vis[j];j=c[j])vis[j]=1,tmp[++tt]=j;

		for(j=1;j<=tt;j++)ans[tmp[j]]=v[tmp[(j+k-1)%tt+1]];

	}

	for(int i=1;i<=n;i++)ans[i]+=ans[i-1],printf("%lld.0\n",ans[i]);

}
// Slower C++ solution:
// LNU_Algotesters

#include <iostream>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cctype>

#include <cstring>

#include <vector>

#include <list>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <algorithm>

#include <iterator>

#include <bitset>

#include <ctime>

#include <fstream>

#include <complex>



using namespace std;



#define FOR(i,a,b) for (int i = (a); i < (b); i++)

#define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)

#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a,value) memset(a, value, sizeof(a))



#define SZ(a) (int)a.size()

#define ALL(a) a.begin(), a.end()

#define PB push_back

#define MP make_pair



typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL) INF;

const int MAX = 100 * 1000 + 47;



int X[MAX];



VI mult(VI &A, VI &B)

{

    VI res(SZ(A));

    FOR(i, 0, SZ(A))

        res[i] = B[A[i]];

    return res;

};





VI BP(VI& P, LL n)

{

    VI res;

    FOR(i, 0, SZ(P))res.PB(i);

    while(n)

    {

        if (n & 1)res = mult(res, P);

        P = mult(P, P);

        n >>= 1;

    }

    return res;

}



int main()

{

    int n;

    scanf("%d", &n);

    FOR(i, 0, n)scanf("%d", X + i);

    int m;

    LL k;

    scanf("%d%lld", &m, &k);

    VI P;

    FOR(i, 0, n-1)

        P.PB(i);

    FOR(i, 0, m)

    {

        int x;

        scanf("%d", &x);

        --x;

        swap(P[x], P[x-1]);

    }

    //cout << m << endl << endl;

    P = BP(P, k);

    LL cur = X[0];

    FOR(i, 0, n)

    {

        printf("%lld\n", cur);

        if (i < SZ(P))cur += X[P[i] + 1] - X[P[i]];

    }

}




// Faster C++ solution for the same problem (measured speedup: 5.16614832162897x):
#include<cstdio>

#include<algorithm>

using namespace std;

#define MAXN 200010

#define LL long long

int dis[MAXN],id[MAXN],n,m,st[MAXN];

LL ans[MAXN];

LL k;

bool vis[MAXN];

int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d",&dis[i]);

		id[i]=i;

	}

	for(int i=n;i;i--)

		dis[i]=dis[i]-dis[i-1];

	scanf("%d%lld",&m,&k);

	int u;

	for(int i=1;i<=m;i++)

	{

		scanf("%d",&u);

		swap(id[u],id[u+1]);

	}

	for(int i=1;i<=n;i++)

		if(!vis[i])

		{

			int c=0;

			for(int j=i;!vis[j];j=id[j]) st[c++]=j,vis[j]=1;

			for(int j=0;j<c;j++)

				ans[st[j]]=dis[st[(k+j)%c]];

		}

	for(int i=1;i<=n;i++)

	{

		ans[i]+=ans[i-1];

		printf("%lld\n",ans[i]);

	}

}
// Slower C++ solution:
#include<cstdio>

#include<algorithm>

#include<cmath>

#include<vector>

#define SF scanf

#define PF printf

#define MAXN 100010

using namespace std;

typedef long long ll;

ll k;

int n,m,t;

int gt[MAXN];

ll a[MAXN],pre[MAXN],ans[MAXN];

vector<int> num;

bool vis[MAXN];

void got(int x){

	vis[x]=1;

	if(num.size()>=1&&x==num[0])

		return ;

	num.push_back(x);

	got(gt[x]);

}

int main(){

	SF("%d",&n);	

	for(int i=1;i<=n;i++)

		SF("%lld",&a[i]);

	for(int i=1;i<=n;i++)

		pre[i]=a[i]-a[i-1];

	SF("%d%lld",&m,&k);

	for(int i=1;i<=n;i++)

		gt[i]=i;

	for(int i=1;i<=m;i++){

		SF("%d",&t);	

		swap(gt[t],gt[t+1]);

	}

	for(int i=1;i<=n;i++){

		if(vis[i]!=0)

			continue;

		got(i);

		int len=num.size();

		ll k1=k%len;

		for(int j=0;j<len;j++)

			ans[num[j]]=pre[num[(j+k1)%len]];

		num.clear();

	}

	ll sum=0;

	for(int i=1;i<=n;i++){

		sum+=ans[i];

		PF("%lld.0\n",sum);

	}

}

// Faster C++ solution for the same problem (measured speedup: 4.798160705729929x):
#include<cstdio>

#include<algorithm>

using namespace std;

#define MAXN 200010

#define LL long long

int dis[MAXN],id[MAXN],n,m,st[MAXN];

LL ans[MAXN];

LL k;

bool vis[MAXN];

int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d",&dis[i]);

		id[i]=i;

	}

	for(int i=n;i;i--)

		dis[i]=dis[i]-dis[i-1];

	scanf("%d%lld",&m,&k);

	int u;

	for(int i=1;i<=m;i++)

	{

		scanf("%d",&u);

		swap(id[u],id[u+1]);

	}

	for(int i=1;i<=n;i++)

		if(!vis[i])

		{

			int c=0;

			for(int j=i;!vis[j];j=id[j]) st[c++]=j,vis[j]=1;

			for(int j=0;j<c;j++)

				ans[st[j]]=dis[st[(k+j)%c]];

		}

	for(int i=1;i<=n;i++)

	{

		ans[i]+=ans[i-1];

		printf("%lld\n",ans[i]);

	}

}
// Slower C++ solution:
// LNU_Algotesters

#include <iostream>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cctype>

#include <cstring>

#include <vector>

#include <list>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <algorithm>

#include <iterator>

#include <bitset>

#include <ctime>

#include <fstream>

#include <complex>



using namespace std;



#define FOR(i,a,b) for (int i = (a); i < (b); i++)

#define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)

#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a,value) memset(a, value, sizeof(a))



#define SZ(a) (int)a.size()

#define ALL(a) a.begin(), a.end()

#define PB push_back

#define MP make_pair



typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL) INF;

const int MAX = 100 * 1000 + 47;



int X[MAX];



VI mult(VI &A, VI &B)

{

    VI res(SZ(A));

    FOR(i, 0, SZ(A))

        res[i] = B[A[i]];

    return res;

};





VI BP(VI& P, LL n)

{

    VI res;

    FOR(i, 0, SZ(P))res.PB(i);

    while(n)

    {

        if (n & 1)res = mult(res, P);

        P = mult(P, P);

        n >>= 1;

    }

    return res;

}



int main()

{

    int n;

    scanf("%d", &n);

    FOR(i, 0, n)scanf("%d", X + i);

    int m;

    LL k;

    scanf("%d%lld", &m, &k);

    VI P;

    FOR(i, 0, n-1)

        P.PB(i);

    FOR(i, 0, m)

    {

        int x;

        scanf("%d", &x);

        --x;

        swap(P[x], P[x-1]);

    }

    //cout << m << endl << endl;

    P = BP(P, k);

    LL cur = X[0];

    FOR(i, 0, n)

    {

        printf("%lld\n", cur);

        if (i < SZ(P))cur += X[P[i] + 1] - X[P[i]];

    }

}




// Faster C++ solution for the same problem (measured speedup: 5.164990295745231x):
#include<cstdio>

#include<algorithm>

using namespace std;

typedef long long ll;

const int MAXN = 100000;

int N, M; ll K;

int x[MAXN + 5];

int a[MAXN + 5], b[MAXN + 5], res[MAXN + 5];

void Pow(ll p) {

	for(int i=1;i<N;i++)

		res[i] = i;

	while( p ) {

		if( p & 1 ) {

			for(int i=1;i<N;i++)

				res[i] = a[res[i]];

		}

		p >>= 1;

		for(int i=1;i<N;i++)

			b[i] = a[a[i]];

		for(int i=1;i<N;i++)

			a[i] = b[i];

	}

}

int main() {

	scanf("%d", &N);

	for(int i=0;i<N;i++)

		scanf("%d", &x[i]);

	for(int i=N-1;i>0;i--)

		x[i] = x[i] - x[i-1];

	scanf("%d%lld", &M, &K);

	for(int i=1;i<N;i++)

		a[i] = i;

	for(int i=1;i<=M;i++) {

		int k;

		scanf("%d", &k);

		swap(a[k-1], a[k]);

	}

	Pow(K);

	ll nw = x[0];

	printf("%lld\n", nw);

	for(int i=1;i<N;i++) {

		nw = nw + x[res[i]];

		printf("%lld\n", nw);

	}

}
// Slower C++ solution:
#include<cstdio>

#include<algorithm>

#include<cmath>

#include<vector>

#define SF scanf

#define PF printf

#define MAXN 100010

using namespace std;

typedef long long ll;

ll k;

int n,m,t;

int gt[MAXN];

ll a[MAXN],pre[MAXN],ans[MAXN];

vector<int> num;

bool vis[MAXN];

void got(int x){

	vis[x]=1;

	if(num.size()>=1&&x==num[0])

		return ;

	num.push_back(x);

	got(gt[x]);

}

int main(){

	SF("%d",&n);	

	for(int i=1;i<=n;i++)

		SF("%lld",&a[i]);

	for(int i=1;i<=n;i++)

		pre[i]=a[i]-a[i-1];

	SF("%d%lld",&m,&k);

	for(int i=1;i<=n;i++)

		gt[i]=i;

	for(int i=1;i<=m;i++){

		SF("%d",&t);	

		swap(gt[t],gt[t+1]);

	}

	for(int i=1;i<=n;i++){

		if(vis[i]!=0)

			continue;

		got(i);

		int len=num.size();

		ll k1=k%len;

		for(int j=0;j<len;j++)

			ans[num[j]]=pre[num[(j+k1)%len]];

		num.clear();

	}

	ll sum=0;

	for(int i=1;i<=n;i++){

		sum+=ans[i];

		PF("%lld.0\n",sum);

	}

}

// Faster C++ solution for the same problem (measured speedup: 4.7970851666734315x):
#include<cstdio>

#include<algorithm>

using namespace std;

typedef long long ll;

const int MAXN = 100000;

int N, M; ll K;

int x[MAXN + 5];

int a[MAXN + 5], b[MAXN + 5], res[MAXN + 5];

void Pow(ll p) {

	for(int i=1;i<N;i++)

		res[i] = i;

	while( p ) {

		if( p & 1 ) {

			for(int i=1;i<N;i++)

				res[i] = a[res[i]];

		}

		p >>= 1;

		for(int i=1;i<N;i++)

			b[i] = a[a[i]];

		for(int i=1;i<N;i++)

			a[i] = b[i];

	}

}

int main() {

	scanf("%d", &N);

	for(int i=0;i<N;i++)

		scanf("%d", &x[i]);

	for(int i=N-1;i>0;i--)

		x[i] = x[i] - x[i-1];

	scanf("%d%lld", &M, &K);

	for(int i=1;i<N;i++)

		a[i] = i;

	for(int i=1;i<=M;i++) {

		int k;

		scanf("%d", &k);

		swap(a[k-1], a[k]);

	}

	Pow(K);

	ll nw = x[0];

	printf("%lld\n", nw);

	for(int i=1;i<N;i++) {

		nw = nw + x[res[i]];

		printf("%lld\n", nw);

	}

}
// Slower C++ solution:
// LNU_Algotesters

#include <iostream>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cctype>

#include <cstring>

#include <vector>

#include <list>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <algorithm>

#include <iterator>

#include <bitset>

#include <ctime>

#include <fstream>

#include <complex>



using namespace std;



#define FOR(i,a,b) for (int i = (a); i < (b); i++)

#define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)

#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a,value) memset(a, value, sizeof(a))



#define SZ(a) (int)a.size()

#define ALL(a) a.begin(), a.end()

#define PB push_back

#define MP make_pair



typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL) INF;

const int MAX = 100 * 1000 + 47;



int X[MAX];



VI mult(VI &A, VI &B)

{

    VI res(SZ(A));

    FOR(i, 0, SZ(A))

        res[i] = B[A[i]];

    return res;

};





VI BP(VI& P, LL n)

{

    VI res;

    FOR(i, 0, SZ(P))res.PB(i);

    while(n)

    {

        if (n & 1)res = mult(res, P);

        P = mult(P, P);

        n >>= 1;

    }

    return res;

}



int main()

{

    int n;

    scanf("%d", &n);

    FOR(i, 0, n)scanf("%d", X + i);

    int m;

    LL k;

    scanf("%d%lld", &m, &k);

    VI P;

    FOR(i, 0, n-1)

        P.PB(i);

    FOR(i, 0, m)

    {

        int x;

        scanf("%d", &x);

        --x;

        swap(P[x], P[x-1]);

    }

    //cout << m << endl << endl;

    P = BP(P, k);

    LL cur = X[0];

    FOR(i, 0, n)

    {

        printf("%lld\n", cur);

        if (i < SZ(P))cur += X[P[i] + 1] - X[P[i]];

    }

}




// Faster C++ solution for the same problem (measured speedup: 5.166863476230139x):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN = 100000;

typedef long long ll;

ll x[MAXN + 5], d[MAXN + 5];

int a[MAXN + 5]; bool tag[MAXN + 5];

int b[MAXN + 5], ans[MAXN + 5];

int main() {

	int N, M; ll K;

	scanf("%d", &N);

	for(int i=1;i<=N;i++) {

		scanf("%lld", &x[i]);

		if( i != 1 ) d[i-1] = x[i] - x[i-1];

	}

	scanf("%d%lld", &M, &K);

	for(int i=1;i<N;i++)

		a[i] = i;

	for(int i=1;i<=M;i++) {

		int x;

		scanf("%d", &x);

		swap(a[x-1], a[x]);

	}

	for(int i=1;i<N;i++) {

		if( tag[i] ) continue;

		int p = i, siz = 0;

		do {

			tag[p] = true;

			b[siz++] = p;

			p = a[p];

		}while( p != i );

		int q = 0;

		for(int j=0;j<siz;j++) {

			ans[b[j]] = b[(j+K)%siz];

		}

	}

	ll nw = x[1];

	for(int i=1;i<=N;i++) {

		printf("%lld\n", nw);

		if( i != N ) nw += d[ans[i]];

	}

}
// Slower C++ solution:
#include<cstdio>

#include<algorithm>

#include<cmath>

#include<vector>

#define SF scanf

#define PF printf

#define MAXN 100010

using namespace std;

typedef long long ll;

ll k;

int n,m,t;

int gt[MAXN];

ll a[MAXN],pre[MAXN],ans[MAXN];

vector<int> num;

bool vis[MAXN];

void got(int x){

	vis[x]=1;

	if(num.size()>=1&&x==num[0])

		return ;

	num.push_back(x);

	got(gt[x]);

}

int main(){

	SF("%d",&n);	

	for(int i=1;i<=n;i++)

		SF("%lld",&a[i]);

	for(int i=1;i<=n;i++)

		pre[i]=a[i]-a[i-1];

	SF("%d%lld",&m,&k);

	for(int i=1;i<=n;i++)

		gt[i]=i;

	for(int i=1;i<=m;i++){

		SF("%d",&t);	

		swap(gt[t],gt[t+1]);

	}

	for(int i=1;i<=n;i++){

		if(vis[i]!=0)

			continue;

		got(i);

		int len=num.size();

		ll k1=k%len;

		for(int j=0;j<len;j++)

			ans[num[j]]=pre[num[(j+k1)%len]];

		num.clear();

	}

	ll sum=0;

	for(int i=1;i<=n;i++){

		sum+=ans[i];

		PF("%lld.0\n",sum);

	}

}

// Faster C++ solution for the same problem (measured speedup: 4.7988249194714285x):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN = 100000;

typedef long long ll;

ll x[MAXN + 5], d[MAXN + 5];

int a[MAXN + 5]; bool tag[MAXN + 5];

int b[MAXN + 5], ans[MAXN + 5];

int main() {

	int N, M; ll K;

	scanf("%d", &N);

	for(int i=1;i<=N;i++) {

		scanf("%lld", &x[i]);

		if( i != 1 ) d[i-1] = x[i] - x[i-1];

	}

	scanf("%d%lld", &M, &K);

	for(int i=1;i<N;i++)

		a[i] = i;

	for(int i=1;i<=M;i++) {

		int x;

		scanf("%d", &x);

		swap(a[x-1], a[x]);

	}

	for(int i=1;i<N;i++) {

		if( tag[i] ) continue;

		int p = i, siz = 0;

		do {

			tag[p] = true;

			b[siz++] = p;

			p = a[p];

		}while( p != i );

		int q = 0;

		for(int j=0;j<siz;j++) {

			ans[b[j]] = b[(j+K)%siz];

		}

	}

	ll nw = x[1];

	for(int i=1;i<=N;i++) {

		printf("%lld\n", nw);

		if( i != N ) nw += d[ans[i]];

	}

}
// Slower C++ solution:
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<vector>

#define MAXN 100000

using namespace std;

typedef long long LL;

int n,m;

LL k;

LL x[MAXN+5];

int ord[MAXN+5];

int ord2[MAXN+5];

LL ans[MAXN+5],fin[MAXN+5];

bool vis[MAXN+5];

vector<int> ned;

int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%lld",&x[i]),ord[i]=i;

		ans[i]=x[i]-x[i-1];

	}

	scanf("%d %lld",&m,&k);

	int p;

	for(int i=1;i<=m;i++)

	{

		scanf("%d",&p);

		swap(ord[p],ord[p+1]);

	}

	for(int i=1;i<=n;i++)

	{

		p=i;

		ned.clear();

		while(vis[p]==false)

		{

			vis[p]=true;

			ned.push_back(p);

			p=ord[p];

		}

		for(int j=0;j<(int)ned.size();j++)

			ord2[ned[j]]=ned[(1LL*j+1LL*k)%(LL)ned.size()];

	}

	for(int i=1;i<=n;i++)

		fin[i]=ans[ord2[i]];

	LL sum=0;

	for(int i=1;i<=n;i++)

	{

		sum+=fin[i];

		printf("%lld.0\n",sum);

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.7980754540105295x):
#include<cstdio>

#include<algorithm>

using namespace std;

const int MAXN = 100000;

typedef long long ll;

ll x[MAXN + 5], d[MAXN + 5];

int a[MAXN + 5]; bool tag[MAXN + 5];

int b[MAXN + 5], ans[MAXN + 5];

int main() {

	int N, M; ll K;

	scanf("%d", &N);

	for(int i=1;i<=N;i++) {

		scanf("%lld", &x[i]);

		if( i != 1 ) d[i-1] = x[i] - x[i-1];

	}

	scanf("%d%lld", &M, &K);

	for(int i=1;i<N;i++)

		a[i] = i;

	for(int i=1;i<=M;i++) {

		int x;

		scanf("%d", &x);

		swap(a[x-1], a[x]);

	}

	for(int i=1;i<N;i++) {

		if( tag[i] ) continue;

		int p = i, siz = 0;

		do {

			tag[p] = true;

			b[siz++] = p;

			p = a[p];

		}while( p != i );

		int q = 0;

		for(int j=0;j<siz;j++) {

			ans[b[j]] = b[(j+K)%siz];

		}

	}

	ll nw = x[1];

	for(int i=1;i<=N;i++) {

		printf("%lld\n", nw);

		if( i != N ) nw += d[ans[i]];

	}

}