N = gets.chomp.to_i
a = Array.new(N)
str = gets.split
for i in 0...N do
    a[i] = str[i].to_i
end

b = Array.new(N)
c = Array.new(N)
b[0] = 0
for x in 1...N do
    b[x] = a[x-1] - b[x-1]
end
c[0] = a[N-1] - b[N-1]
for x in 1...N do
    c[x] = a[x-1] - c[x-1]
end
for x in 0...N-1 do
    print (b[x]+c[x])
    print " "
end
puts (b[N-1]+c[N-1])