program  Rabbit_Exercise
  implicit none
  integer::N,M
  integer(16)::K
  integer(16),allocatable,dimension(:)::X,A

  integer(16),allocatable,dimension(:)::dE,dE_rep!期待値の差分
  integer,allocatable,dimension(:)::Rep!置換
  integer(16),allocatable,dimension(:)::ANS
  integer::i

  read*,N
  allocate(X(N))
  read*,X
  read*,M,K
  allocate(A(M))
  read*,A

  !期待値差分初期化
  allocate(dE(N-1))
  do i=1,N-1
    dE(i)=X(i+1)-X(i)
  end do

  !一セット分の置換を計算
    !置換初期化
    allocate(Rep(N-1))
    do i=1,N-1
      Rep(i)=i
    end do
    !一セット分の置換
    do i=1,M
      call swap(Rep(A(i)),Rep(A(i)-1))
    end do
  !Kセット分の置換を計算
    Rep=Rep_Pow(N-1,Rep,K)
  allocate(dE_Rep(N-1))
  dE_Rep=0
  do i=1,N-1
    dE_rep(I)=dE(rep(I))
  end do
  allocate(ANS(N))
  ANS(1)=X(1)
  do i=2,N
    ANS(I)=ANS(i-1)+dE_Rep(i-1)
  end do
  print"(I0)",ANS
contains
  
  subroutine swap(x,y)
    integer::x,y
    x=xor(x,y)
    y=xor(x,y)
    x=xor(x,y)
  end subroutine swap

  function Rep_Pow(si,Re,N)result(res)
    integer,intent(in)::si,Re(1:si)
    integer(16)::N
    integer::res(1:si),B(1:si)
    integer::i
    do i=1,si
      res(i)=i
    end do
    B=Re
    do i=1,bit_size(N)
      if(btest(N,i-1))res=rep_mul(si,res,B)
      B=rep_mul(si,B,B)
    end do
  end function
  function rep_mul(si,A,B)result(res)
    integer,intent(in)::si,A(si),B(si)
    integer::res(si)
    integer::i
    do i=1,SI 
      res(i)=A(B(i))
    end do
  end function
end program Rabbit_Exercise