n = gets.to_i
a = gets.split(' ').map {|i| i.to_i}
w = []

total = a.inject(:+)
half = 0
a.each.with_index(1) do |_a, i|
  if i % 2 == 0
    half += _a * 2
  end
end

w << total - half

0.upto(n-2) do |i|
  w << 2 * a[i] - w[i]
end

puts w.join(' ')