n = gets.to_i
aa = gets.split.map(&:to_i)

wat = []

sum = aa.inject(:+)
odd_sum = 0

aa.each_with_index do |a,i|
  odd_sum+=a if i%2==1
end

x0 = sum - 2 * odd_sum
wat << x0

1.upto(n-1) do |nn|
  # x_i = 2a_(i-1)-x_(i-1)
  wat << 2 * aa[nn-1] - wat.last
end

puts wat.join(' ')
