#include namespace nono { void solve() { int n, w; std::cin >> n >> w; int ans = -1; for (int i = 0; i < n; i++) { int a, b; std::cin >> a >> b; if (b <= w) { ans = std::max(ans, a); } } std::cout << ans << std::endl; } } // namespace nono int main() { std::cin.tie(0)->sync_with_stdio(false); std::cout << std::fixed << std::setprecision(15); int t = 1; while (t--) nono::solve(); }