n,d=gets.split.map &:to_i print y=z=0 a=gets.split.map{|b|print ' ',z=[z+d,y+=b.to_i].max}