program dam
  implicit none
  integer(8) :: n, i
  integer(8),allocatable :: water(:)
  integer(8),allocatable :: rain(:)
  
  read *, n 
  allocate(water(n),rain(n))
  read *, water
  rain = 0
  do i = 1, n 
    rain(1) = rain(1) - water(i)*(-1)**i
  end do 
  do i = 2, n 
    rain(i) = 2*(water(i-1)-rain(i-1)/2)
  end do 
  do i = 1, n-1
    write (*,'(i0,a)',advance="no") rain(i), " "
  end do
  write (*,'(i0)',advance="no") rain(n)
  stop
end program dam
