#include using namespace std; int main(){ int N, W; cin >> N >> W; int ans = -1; while(N--){ int n, w; cin >> n >> w; if(w <= W) ans = max(n, ans); } cout << ans; }