n = gets.to_i
arr = gets.split(' ').map(&:to_i)
sum = arr.sum
even_sum = arr.each_with_index.inject(0) { |a, (v, i)| i % 2 != 0 ? a + v : a }
results = [sum - 2 * even_sum]
1.upto(n - 1) do |i|
  results.push(2 * arr[i - 1] - results[i - 1])
end
puts results.join(' ')