n=gets.to_i
array=gets.split.map(&:to_i)
sum=array.inject(:+)
answer=[]

otherthan1=0
i=1
(array.length/2).times{
  otherthan1+=array[i]*2
  i+=2  
}

answer<<sum-otherthan1


(n-1).times{|i|
    answer<<array[i]*2-answer[-1]
}

puts answer.join(' ')