N = gets.to_i
DAMS = gets.split.map(&:to_i)

def mountains(first_mountain)
  mountains = [first_mountain]
  (1...N).each do |i|
    next_mountain = (DAMS[i - 1] - mountains.last / 2) * 2
    mountains << next_mountain
  end
  mountains
end

def bsearch(from, to)
  while true
    mid = (from + to) / 2
    if from + 1 == to
      mountains = mountains(from)
      return (mountains.first * mountains.last) / 2 >= DAMS.last ? from : to
    end
    mountains = mountains(mid)
    if (mountains.first * mountains.last) / 2 >= DAMS.last
      to = mid
    else
      from = mid
    end
  end
end

puts mountains(bsearch(0, DAMS[0] * 2)).join(" ")
