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

rains = [0] * N
AS.size.times do |i|
  rains[0] += AS[i] * ((-1)**(i % 2))
end

1.upto(N - 1) do |i|
  rains[i] = (AS[i - 1] - rains[i - 1] / 2) * 2
end

puts rains.join(" ")
