
n = gets.to_i
datas = gets.split(" ").map{|n|n.to_i}
allrain = datas.inject(:+)
lastrain = allrain
#まず一つ解く
((n-1) / 2).times do|idx|
  lastrain -= datas[idx*2+1]*2
end

rains = []

#頭が分かる
rains << datas[0]*2 - lastrain

for idx in 0..(n-3) do
  rains << datas[idx+1]*2 - rains[idx]
end

rains.unshift(lastrain)

puts rains.join(" ")