N, D = gets.split.map(&:to_i) A = gets.split.map(&:to_i) B = [0] A.each do |a| B << B.last + a end pos = 0 ans = [0] B[1..-1].each do |b| np = pos + D if np <= b ans << b pos = b else ans << np pos = np end end puts ans.join(' ')