N, M = gets.split.map(&:to_i) W = gets.split.map(&:to_i) gcd = W.inject(&:gcd) S = W.sum BW = Rational(S, M) NW = W.map { |x| x / gcd } def f(r) NW.map { |x| x * r }.sum <= M end ok = 1 ng = 10 ** 9 while (ok - ng).abs >= 2 r = (ok + ng) / 2 if f(r) ok = r else ng = r end end puts NW.map { |x| x * ok }.join(' ')