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

x = 0
n.times do |i|
    if i%2 == 0 then
        x += a[i]
    else
        x -= a[i]
    end
end

ans = [x]
rain = x
(n-1).times do |i|
    rain = (a[i] - rain/2) * 2
    ans << rain
end

print(ans * " ")
    

