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

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