N = gets.to_i
a = gets.split.map(&:to_i)
all = a.reduce(:+)
a_odd = 0
a[0...-1].each_with_index do |v, i|
  next if i % 2 == 1
  a_odd += v
end
last_v = all - a_odd * 2
first_v = (a[-1]*2 - last_v)
ans = []
ans << first_v
a.each do |v|
  ans << v * 2 - ans[-1]
end
puts ans[0...-1]