integer N
integer(8),allocatable,dimension(:)::A
integer(8),allocatable,dimension(:)::ans
integer(8) Asum
read*,N
allocate(A(n),ans(N))
read*,A
Asum=sum(A)

do i=1,N/2
  Asum=Asum-A(i*2-1)*2
end do

ans(N)=Asum

ans(1)=A(N)*2-ans(N)

do i=2,N
  ans(i)=A(i-1)*2-ans(i-1)
end do

print*,ans

end