n=gets.chomp.to_i
arr=gets.chomp.split(" ").map(&:to_i)
x1=arr.inject(&:+)-2*arr.each_slice(2).select{|n| n if n.size == 2}.map{|n| n[1]}.inject(&:+)
ans=[x1]
xi = x1
i=0
arr.each do |ai|
  break if i == n-1
  xi2 = 2*ai - xi
  xi = xi2
  ans << xi2
  i+=1
end
puts(ans.join(" "))