#include using namespace std; using ll =long long; #define all(v) v.begin(),v.end() #define rep(i,a,b) for(int i=a;i=b;i--) ll INF=2e18; int main() { ios::sync_with_stdio(false); cin.tie(0); ll N,W;cin>>N>>W; ll ans=-1; for(ll i=0;i>v>>w; if(w<=W) ans=max(ans,v); } cout<