n = gets.chomp.to_i
a_arr = gets.chomp.split(" ").map(&:to_i)

x_arr = []

x_arr << a_arr.map.with_index do |a, i|
  if i % 2 == 0 then
    a
  else
    a * (-1)
  end
end.inject(:+) / 2

a_arr.each_with_index do |a, i|
  x_arr << a - x_arr[i]
end

puts x_arr[0..-2].map{|x| (x * 2).to_s }.join(" ")
