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()))

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

t=sorted(t,key=lambda t:t[0])

total=0

for i in range(n):

    total+=t[i][1]

    if k<=total:

        print((t[i][0]))

        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()))
t = [tuple(map(int, input().split())) for i in range(n)]
t = sorted(t, key=lambda t: t[0])
total = 0
for i in range(n):
    total += t[i][1]
    if k <= total:
        print((t[i][0]))
        exit()

-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) +t = [tuple(map(int, input().split())) for i in range(n)] +t = sorted(t, key=lambda t: t[0]) +total = 0 +for i in range(n): +    total += t[i][1] +    if k <= total: +        print((t[i][0]))