N,W = map(int,input().split()) dat = [-1] * (W + 1) dat[0] = 0 for _ in range(N): w,v = map(int,input().split()) for i in range(W - w,-1,-1): if dat[i] >= 0: dat[i + w] = max(dat[i + w],dat[i] + v) V = max(dat) for i in range(1,W + 1): dat[i] = max(dat[i],dat[i-1]) for i in range(1,W + 1): print(V - dat[W - i] + 1)