program abc133d
  use,intrinsic :: iso_fortran_env
  implicit none
  integer :: n, i
  integer(int64) :: x
  integer,dimension(:),allocatable :: a, ans
  integer,dimension(:,:),allocatable :: b

  read *, n
  allocate(a(n),ans(n))
  read *, a
  b = reshape(a(2:),[2,n/2])
  x = sum(a) - sum(b(1,:)) * 2
  ans(1) = x
  do i = 1,n-1
     x = a(i) * 2 - x
     ans(i+1) = x
  end do
  print *, ans
end program abc133d
