local n=io.read("*n")
local a={}
local suma=0
local sumaeven=0
for i=1,n do
    a[i]=io.read("*n")
    suma=suma+a[i]
    if i%2==0 then
        sumaeven=sumaeven+a[i]
    end
end

local x={suma-2*sumaeven}
for i=1,n-1 do
    x[i+1]=2*a[i]-x[i]
end
print(table.concat(x," "))