program dm
  implicit none
  integer :: N,i,edge
  integer,allocatable ::A(:)
  integer,allocatable :: ans(:)

  read(*,*) N
  allocate(A(N))
  allocate(ans(N))
  read(*,*) A

  edge=0
  do i=1,n
     edge=edge-((-1)**i)*A(i)
  enddo
  ans(1)=edge/2
  do i=2,n
     ans(i)=(A(i-1)-ans(i-1))
  enddo
  do i=1,n
     write(*,'(i0)',advance='no') ans(i)*2
     write(*,'(a)',advance='no') ' '
  enddo
  write(*,*)
end program dm




