program main
 implicit none
 integer*16 N,i,S
 integer*16, allocatable::A(:),B(:)
 read(*,*) N
 allocate(A(1:N), B(1:N))
 read(*,*) A
 S = 0D0
 do i=1,N
  S = S + A(i)
 end do
 do i=1,(N-1)/2
  S = S - 2*A(2*i)
 end do
 B(1) = S
 do i=2,N
  B(i) = 2*A(i-1) - B(i-1)
 end do
 write(*,*) B(1:N)
end program main