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

xs = []
xs[0] = A.inject(:+) - 2 * 1.step(N - 1, 2).inject(0) { |sum, ai| sum + A[ai] }

1.upto(N-1) do |i|
  xs[i] = 2 * A[i-1] - xs[i-1]
end

puts xs.join(' ')