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

rain = 0
for i in 1..n do
    if i.odd? 
        rain += a[i-1]
    else
        rain -= a[i-1]
    end
end

print rain," "


for i in 1..n-1 do
    rain = 2*(a[i-1] - (rain/2))
    print rain, " "
end