#include using namespace std; const int N=1e5+10; int f[N]; int n,m,x,y; int main(){ scanf("%d%d",&n,&m); for (int i=1;i<=n;i++){ scanf("%d%d",&x,&y); for (int j=m;j>=x;j--) f[j]=max(f[j],f[j-x]+y); } for (int i=m-1;i>=0;i--) printf("%d\n",f[m]-f[i]+1); }