n = gets.chomp.to_i

dams = gets.chomp.split(" ").map(&:to_i)
total = dams.inject(:+)

ans = Array.new(n, 0)
temp_total = 0
n.times do |i|
    next if i % 2 == 0
    temp_total += dams[i]
end
ans[0] = total - 2 * temp_total
(n - 1).times do |i|
    ans[i + 1] = 2 * dams[i] - ans[i]
end

puts ans.join(" ")
