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

X = []
a_odd = (0...N).select {|i| i % 2 == 1 }.map { |i| A[i] }
a_even = (0...N).select {|i| i % 2 == 0 }.map { |i| A[i] }
X[0] = a_even.inject(:+) - a_odd.inject(:+)
1.upto(N-1) do |i|
  X[i] = 2 * (A[i-1] - X[i-1] / 2)
end
puts X.join(" ")
