n = gets.chomp.to_i
as = gets.chomp.split.map(&:to_i)

ms = []
ms[0] = 0

(1..n).each do |i|
    ms[i] = 2 * as[i-1] - ms[i-1]
end

diff = (ms[n] - ms[0]) / 2

puts ms.take(n).each_with_index.map { |m, i| i.even? ? m + diff : m - diff }.join(' ')
