# frozen_string_literal: true

n = gets.to_i
a = gets.split.map(&:to_i)
sum = 0
0.upto(n - 1) do |i|
  sum += i.even? ? a[i] : -a[i]
end
x = []
x.push sum
prev = sum
1.upto(n - 1) do |i|
  xx = 2 * a[i - 1] - prev
  x.push xx
  prev = xx
end
puts x.join(' ')
