n, w = read_line.split.map(&.to_i) u = Array.new(n){0} v = Array.new(n){0} n.times do |i| u[i], v[i] = read_line.split.map(&.to_i) end d = Array.new(n+1){Array.new(w+1, 0_i64)} d[0][0] = 0_i64 n.times do |i| (w+1).times do |j| if j - u[i] >= 0 d[i+1][j] = [d[i][j], d[i][j-u[i]] + v[i]].max else d[i+1][j] = d[i][j] end end end w.times {|i| puts d[n][w] - d[n][w-i-1] + 1 }