program rabbit_exercise
  implicit none
  integer :: n, m, a(100000) = 0, b(100000) = 0, tmp, i, j
  integer :: c(100000) = 0, idx(100000) = 0
  integer(8) :: k, x(100000) = 0_8, dx(100000) = 0_8, s
  read(*,*) n
  read(*,*) x(1:n)
  read(*,*) m, k
  read(*,*) a(1:m)
  do i = 1, n-1
    dx(i) = x(i+1)-x(i)
    b(i) = i
    idx(i) = i
  end do
  do i = 1, m
    tmp = b(a(i)-1)
    b(a(i)-1) = b(a(i))
    b(a(i)) = tmp
  end do
  do j = 0, 62
    if (btest(k,j)) then
      do i = 1, n
        c(i) = idx(b(i))
      end do
      idx(1:n) = c(1:n)
    end if
    do i = 1, n
      c(i) = b(b(i))
    end do
    b(1:n) = c(1:n)
  end do
  s = x(1)
  do i = 1, n
    write(*,'(i0)') s
    s = s+dx(idx(i))
  end do
  stop
end program rabbit_exercise