n,k=list(map(int,input().split()))

num=[list(map(int,input().split()))for _ in range(n)]

p=0

num.sort()

for i in range(n):

    p+=num[i][1]

    if k<=p:

        ans=num[i][0]

        print(ans)

        exit()

n,k=list(map(int,input().split()))

a=[list(map(int,input().split()))for i in range(n)]

a.sort(key=lambda x:x[0])

count=0

for i,j in a:

    count+=j

    if k<=count:

        print(i)

        exit()
n, k = list(map(int, input().split()))
num = [list(map(int, input().split())) for _ in range(n)]
p = 0
num.sort()
for i in range(n):
    p += num[i][1]
    if k <= p:
        ans = num[i][0]
        print(ans)
        exit()

n, k = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(n)]
a.sort(key=lambda x: x[0])
count = 0
for i, j in a:
    count += j
    if k <= count:
        print(i)
        exit()

-num = [list(map(int, input().split())) for _ in range(n)] -p = 0 -num.sort() -for i in range(n): -    p += num[i][1] -    if k <= p: -        ans = num[i][0] -        print(ans) +a = [list(map(int, input().split())) for i in range(n)] +a.sort(key=lambda x: x[0]) +count = 0 +for i, j in a: +    count += j +    if k <= count: +        print(i)