n = gets.to_i
rain = gets.split.map(&:to_i)
ans = 0
for i in 0..n-1
  if i % 2 == 0
    ans += rain[i]
  else
    ans -= rain[i]
  end
end
  print "#{ans}"
for i in 0..n-2
  ans = (rain[i] - (ans/2))*2
  print " #{ans}"
end
puts ""
