n = gets.to_i
vols = gets.split.map(&:to_i)

m_vols = [0] * n
diffs = vols.zip(vols.rotate(1)).map{|a, b| (b - a) * 2}

(0..(n - 2)).step(2).each{|i| m_vols[i + 2] = m_vols[i] + diffs[i]}
m_vols[1] = m_vols.last + diffs.last
(1..(n - 3)).step(2).each{|i| m_vols[i + 2] = m_vols[i] + diffs[i]}

diff = (vols.inject(:+) - m_vols.inject(:+)) / n
puts m_vols.map{|v| v + diff}.join(" ")
