require "matrix"
n = gets.chop.to_i
arrays=[]
numbers = gets.strip.split.map(&:to_i)
n.times do |i|
arr = Array.new(n)
arr.fill('0'.to_i)
arr[i-1]=0.5
arr[i]=0.5
arrays << arr
end

ans = Matrix.rows(arrays, true).lup.solve(numbers).to_a
ans.unshift(ans[-1])
ans.delete_at(-1)
puts ans.map(&:to_i)