N,W=map(int,input().split()) ans=-1 for _ in range(N): n,w=map(int,input().split()) if w>W:continue ans=max(ans,n) print(ans)