n = gets.to_i
dams = gets.split.map(&:to_i)

acc = 0
dams.reverse.each_with_index {|d, i| acc += (-1) ** i * d}

rain = Array.new(n, 0)
rain[0] = acc

(1...n).each {|i| rain[i] = 2 * (dams[i - 1] - rain[i - 1] / 2)}

puts rain.join(" ")