require 'matrix'

N = gets.chomp.to_i
Meters = gets.chomp.split(' ').map(&:to_i)[0..N]
Meters2x = Meters.map{ |i| i*2 }

x1 = Meters.reduce(0, &:+) - Meters2x.select.with_index { |v, i| i.odd? }.reduce(0, &:+)

puts (0.upto(N-2).reduce([x1]) do |solution, i|
  solution.push Meters2x[i] - solution.last
end).join(" ")
