n = gets.to_i
d = gets.split.map(&:to_i)
mount = Array.new(n, 0)
m1 = 0
d.each_with_index do |w, i|
  if i.even?
    m1 += w
  else
    m1 -= w
  end
end
mount[0] = m1
(n - 1).downto(1) do |i|
  mount[i] = if i == n - 1
               (d[i] - mount[0]/2)*2
             else
               (d[i] - mount[i + 1]/2)*2
             end
end

puts mount.join(' ')