local mce, mfl, msq, mmi, mma = math.ceil, math.floor, math.sqrt, math.min, math.max
local n = io.read("*n")
local a = {}
local sum = 0
for i = 1, n do
  a[i] = 2 * io.read("*n")
  sum = sum + a[i]
end
sum = sum / 2
-- get t1
local t = {}
t[1] = sum
for i = 2, n, 2 do
  t[1] = t[1] - a[i]
end
-- print(t[1])
for i = 2, n do
  t[i] = a[i - 1] - t[i - 1]
end
io.write(t[1])
for i = 2, n do
  io.write(" " .. t[i])
end
io.write("\n")
