def solve(): N,W=map(int,input().split()) inf=float("inf") DP=[-inf]*(W+1); DP[0]=0 for i in range(N): w,v=map(int,input().split()) for x in range(W-w,-1,-1): DP[x+w]=max(DP[x+w], DP[x]+v) for x in range(1,W+1): DP[x]=max(DP[x], DP[x-1]) S=DP[W] return [S+1-DP[W-X] for X in range(1,W+1)] #================================================== print(*solve(),sep="\n")