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

x = 0
(1..N).each do |n|
  if n%2 == 0
    x -= A[n-1]
  else
    x += A[n-1]
  end
end
x /= 2

ans = Array.new(N)
ans[0] = x
(N-1).times do |i|
  ans[i+1] = A[i] - ans[i]
end
ans.map!{|a|a*2}
puts ans.join(" ")