n = gets.chomp.to_i
arr = gets.chomp.split(" ").map{|i|i = i.to_i}
sum = 0
mountain_rain = []
(arr.length/2).times do|ii|
  i = ii*2+1
  sum += arr[i]*2
end

mountain_rain << arr.sum - sum

(n-1).times do|i|
  mountain_rain << 2*arr[i] - mountain_rain[i]
  printf("%d ", mountain_rain[i])
end
puts mountain_rain[mountain_rain.length-1]