def solve(): N,W=map(int,input().split()) inf=10**18 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]) return [DP[W]-DP[W-X]+1 for X in range(1,W+1)] #================================================== print(*solve(),sep="\n")