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

ab=[]

for _ in range(n):

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

  ab.append((a,b))

ab.sort()

for i,j in ab:

  k-=j

  if k<=0:

    print(i)

    exit()
n,k,*l=list(map(int,open(0).read().split()))

for a,b in sorted(zip(l[::2],l[1::2])):

 k-=b

 if k<1:print(a);exit()
n, k = list(map(int, input().split()))
ab = []
for _ in range(n):
    a, b = list(map(int, input().split()))
    ab.append((a, b))
ab.sort()
for i, j in ab:
    k -= j
    if k <= 0:
        print(i)
        exit()

n, k, *l = list(map(int, open(0).read().split()))
for a, b in sorted(zip(l[::2], l[1::2])):
    k -= b
    if k < 1:
        print(a)
        exit()

-n, k = list(map(int, input().split())) -ab = [] -for _ in range(n): -    a, b = list(map(int, input().split())) -    ab.append((a, b)) -ab.sort() -for i, j in ab: -    k -= j -    if k <= 0: -        print(i) +n, k, *l = list(map(int, open(0).read().split())) +for a, b in sorted(zip(l[::2], l[1::2])): +    k -= b +    if k < 1: +        print(a)