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

L=[]

for s in range(n):

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

  L.append((a,b))

#print(L)

L=sorted(L,key=lambda x:x[0])

#print(L)

sun=0

for s in L:

  sun+=s[1]

  if sun+1>k:

    print((s[0]))

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

for s,t in sorted([list(map(int,input().split()))for i in range(n)],key=lambda x:x[0]):

    if k>t:

        k-=t

    else:

        print(s)

        exit()

    
n, k = list(map(int, input().split()))
L = []
for s in range(n):
    a, b = list(map(int, input().split()))
    L.append((a, b))
# print(L)
L = sorted(L, key=lambda x: x[0])
# print(L)
sun = 0
for s in L:
    sun += s[1]
    if sun + 1 > k:
        print((s[0]))
        exit()

n, k = list(map(int, input().split()))
for s, t in sorted(
    [list(map(int, input().split())) for i in range(n)], key=lambda x: x[0]
):
    if k > t:
        k -= t
    else:
        print(s)
        exit()

-L = [] -for s in range(n): -    a, b = list(map(int, input().split())) -    L.append((a, b)) -# print(L) -L = sorted(L, key=lambda x: x[0]) -# print(L) -sun = 0 -for s in L: -    sun += s[1] -    if sun + 1 > k: -        print((s[0])) +for s, t in sorted( +    [list(map(int, input().split())) for i in range(n)], key=lambda x: x[0] +): +    if k > t: +        k -= t +    else: +        print(s)