#include using i64 = long long; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int N, W; std::cin >> N >> W; std::vector dp(W + 1, 0); for (int i = 0; i < N; i++) { int w, v; std::cin >> w >> v; for (int j = W; j >= w; j--) { dp[j] = std::max(dp[j], dp[j - w] + v); } } for (int x = 1; x <= W; x++) { std::cout << dp[W] - dp[W - x] + 1 << "\n"; } return 0; }