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

xx2 = 0
for i in 0...n
    if i%2 == 0
        xx2 += a[i]
    else
        xx2 -= a[i]
    end
end

x2 = Array.new(n)
x2[0] = xx2
for i in 1...n
    x = a[i-1] - (x2[i-1] / 2)
    x2[i] = x * 2
end

puts x2.join(" ")

