N = gets.chomp.to_i
A = gets.chomp.split.map(&:to_i)

x = 0

A.each_with_index do |a, i|
  if i.even?
    x += a
  else
    x -= a
  end
end

x /= 2

ans = []
ans[0] = x

(A.size - 1).times do |i|
  ans[i + 1] = A[i] - ans[i]
end

puts ans.map { |n| n * 2 }.join(' ')
