require 'matrix'

N = gets.chomp.to_i
Meters = gets.chomp.split(' ').map(&:to_i)[0..N]

matrix = Matrix.build(N) do |y, x|
  if x == y
    then 1
  elsif y == 0 && x == N-1
    then 1
  elsif x == y-1
    then 1
  else
    0
  end
end

estimates = Meters.dup
estimates.unshift estimates.pop
solution = matrix.lup.solve estimates.map{ |i| i*2 }

puts solution.to_a.map{ |i| i.floor }.join(' ')
