require 'matrix'

input_line = gets.chomp
n = input_line.to_i
dams = Array.new(n,0)
a = Array.new(n).map{Array.new(n,0)}

input_line = gets.chomp.split(" ")
for i in 0 .. n-1
  dams[i] = input_line[i].to_i
end
for i in 0 .. n-2
  a[i][i] = 0.5
  a[i][i+1] = 0.5
end
a[n-1][0] = 0.5
a[n-1][n-1] = 0.5
m = Matrix[*a]
#p m
b = m.lup.solve(dams)
for i in 0 .. n - 2
  printf("%d ",b[i].to_i)
end
printf("%d\n",b[n-1].to_i)

