import bisect



N, K = list(map(int, input().split()))

d = []





for i in range(N):

    a, b = list(map(int, input().split()))

    d.append([a,b])



d.sort()



l = [0] * N

l[0] = d[0][1]



for i in range(1, N):

    l[i] = d[i][1]+ l[i-1]



pos = bisect.bisect_left(l, K)

print((d[pos][0]))
import sys

import bisect



N, K = list(map(int, sys.stdin.readline().split()))

d = []





for i in range(N):

    a, b = list(map(int, sys.stdin.readline().split()))

    d.append([a,b])



d.sort()



l = [0] * N

l[0] = d[0][1]



for i in range(1, N):

    l[i] = d[i][1]+ l[i-1]



pos = bisect.bisect_left(l, K)

print((d[pos][0]))
import bisect

N, K = list(map(int, input().split()))
d = []
for i in range(N):
    a, b = list(map(int, input().split()))
    d.append([a, b])
d.sort()
l = [0] * N
l[0] = d[0][1]
for i in range(1, N):
    l[i] = d[i][1] + l[i - 1]
pos = bisect.bisect_left(l, K)
print((d[pos][0]))

import sys
import bisect

N, K = list(map(int, sys.stdin.readline().split()))
d = []
for i in range(N):
    a, b = list(map(int, sys.stdin.readline().split()))
    d.append([a, b])
d.sort()
l = [0] * N
l[0] = d[0][1]
for i in range(1, N):
    l[i] = d[i][1] + l[i - 1]
pos = bisect.bisect_left(l, K)
print((d[pos][0]))

+import sys -N, K = list(map(int, input().split())) +N, K = list(map(int, sys.stdin.readline().split())) -    a, b = list(map(int, input().split())) +    a, b = list(map(int, sys.stdin.readline().split()))