import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



import numpy as np



"""

・対象のうさぎの期待値だけ分かれば、次時点での期待値が分かる

・期待値の差分Yを持つ。操作は、Y[i-1]とY[i]の交換

"""



N = int(readline())

X = np.zeros(N+1,np.int64)

X[1:] = readline().split()

M,K = list(map(int,readline().split()))

A = list(map(int,read().split()))



Y = np.diff(X)



# newY[i] = Y[P[i]]

P = list(range(N))

for a in A:

    P[a],P[a-1] = P[a-1],P[a]

P = np.array(P)



def mult_perm(P,Q):

    return P[Q]



def power_perm(P,N):

    if N == 0:

        return np.arange(len(P))

    Q = power_perm(P,N//2)

    Q = mult_perm(Q,Q)

    return mult_perm(P,Q) if N & 1 else Q



Q = power_perm(P,K)



newY = Y[Q]

newX = np.cumsum(newY)



print(('\n'.join(newX.astype(str))))
import sys

import numpy as np



read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



def main(N, M, K, X, A):

    def compute_perm(A):

        P = np.arange(N - 1)

        for i in A:

            P[i - 2], P[i - 1] = P[i - 1], P[i - 2]

        return P



    def power(P, K):

        Q = P.copy()

        x = np.arange(len(P), dtype=np.int32)

        while K:

            if K & 1:

                x = x[Q]

            Q = Q[Q]

            K >>= 1

        return x



    P = compute_perm(A)

    P = power(P, K)

    D = X[1:] - X[:-1]

    D = D[P]

    ret = np.zeros(N, np.int64)

    ret[0] = X[0]

    ret[1:] = np.cumsum(D) + X[0]

    return ret



signature = '(i8,i8,i8,i8[:],i4[:])'

if sys.argv[-1] == 'ONLINE_JUDGE':

    from numba.pycc import CC

    cc = CC('my_module')

    cc.export('main', signature)(main)

    cc.compile()



from my_module import main



N = int(readline())

X = np.array(readline().split(), np.int64)

M, K = list(map(int, readline().split()))

A = np.array(readline().split(), np.int32)



x = main(N, M, K, X, A)

print(('\n'.join(map(str, x.tolist()))))
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

"""
・対象のうさぎの期待値だけ分かれば、次時点での期待値が分かる
・期待値の差分Yを持つ。操作は、Y[i-1]とY[i]の交換
"""
N = int(readline())
X = np.zeros(N + 1, np.int64)
X[1:] = readline().split()
M, K = list(map(int, readline().split()))
A = list(map(int, read().split()))
Y = np.diff(X)
# newY[i] = Y[P[i]]
P = list(range(N))
for a in A:
    P[a], P[a - 1] = P[a - 1], P[a]
P = np.array(P)


def mult_perm(P, Q):
    return P[Q]


def power_perm(P, N):
    if N == 0:
        return np.arange(len(P))
    Q = power_perm(P, N // 2)
    Q = mult_perm(Q, Q)
    return mult_perm(P, Q) if N & 1 else Q


Q = power_perm(P, K)
newY = Y[Q]
newX = np.cumsum(newY)
print(("\n".join(newX.astype(str))))

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main(N, M, K, X, A):
    def compute_perm(A):
        P = np.arange(N - 1)
        for i in A:
            P[i - 2], P[i - 1] = P[i - 1], P[i - 2]
        return P

    def power(P, K):
        Q = P.copy()
        x = np.arange(len(P), dtype=np.int32)
        while K:
            if K & 1:
                x = x[Q]
            Q = Q[Q]
            K >>= 1
        return x

    P = compute_perm(A)
    P = power(P, K)
    D = X[1:] - X[:-1]
    D = D[P]
    ret = np.zeros(N, np.int64)
    ret[0] = X[0]
    ret[1:] = np.cumsum(D) + X[0]
    return ret


signature = "(i8,i8,i8,i8[:],i4[:])"
if sys.argv[-1] == "ONLINE_JUDGE":
    from numba.pycc import CC

    cc = CC("my_module")
    cc.export("main", signature)(main)
    cc.compile()
from my_module import main

N = int(readline())
X = np.array(readline().split(), np.int64)
M, K = list(map(int, readline().split()))
A = np.array(readline().split(), np.int32)
x = main(N, M, K, X, A)
print(("\n".join(map(str, x.tolist()))))

+import numpy as np -import numpy as np - -""" -・対象のうさぎの期待値だけ分かれば、次時点での期待値が分かる -・期待値の差分Yを持つ。操作は、Y[i-1]とY[i]の交換 -""" -N = int(readline()) -X = np.zeros(N + 1, np.int64) -X[1:] = readline().split() -M, K = list(map(int, readline().split())) -A = list(map(int, read().split())) -Y = np.diff(X) -# newY[i] = Y[P[i]] -P = list(range(N)) -for a in A: -    P[a], P[a - 1] = P[a - 1], P[a] -P = np.array(P) -def mult_perm(P, Q): -    return P[Q] +def main(N, M, K, X, A): +    def compute_perm(A): +        P = np.arange(N - 1) +        for i in A: +            P[i - 2], P[i - 1] = P[i - 1], P[i - 2] +        return P + +    def power(P, K): +        Q = P.copy() +        x = np.arange(len(P), dtype=np.int32) +        while K: +            if K & 1: +                x = x[Q] +            Q = Q[Q] +            K >>= 1 +        return x + +    P = compute_perm(A) +    P = power(P, K) +    D = X[1:] - X[:-1] +    D = D[P] +    ret = np.zeros(N, np.int64) +    ret[0] = X[0] +    ret[1:] = np.cumsum(D) + X[0] +    return ret -def power_perm(P, N): -    if N == 0: -        return np.arange(len(P)) -    Q = power_perm(P, N // 2) -    Q = mult_perm(Q, Q) -    return mult_perm(P, Q) if N & 1 else Q +signature = "(i8,i8,i8,i8[:],i4[:])" +if sys.argv[-1] == "ONLINE_JUDGE": +    from numba.pycc import CC +    cc = CC("my_module") +    cc.export("main", signature)(main) +    cc.compile() +from my_module import main -Q = power_perm(P, K) -newY = Y[Q] -newX = np.cumsum(newY) -print(("\n".join(newX.astype(str)))) +N = int(readline()) +X = np.array(readline().split(), np.int64) +M, K = list(map(int, readline().split())) +A = np.array(readline().split(), np.int32) +x = main(N, M, K, X, A) +print(("\n".join(map(str, x.tolist()))))