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

li=[]

for _ in range(n):

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

  li.append([a,b])

li.sort()



ans=0

for a,b in li:

  ans += b

  if k <= ans:

    print(a)

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

li=[]

for _ in range(n):

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

  li.append([a,b])

li.sort()



for a,b in li:

  k -= b

  if k <= 0:

    print(a)

    break
n, k = list(map(int, input().split()))
li = []
for _ in range(n):
    a, b = list(map(int, input().split()))
    li.append([a, b])
li.sort()
ans = 0
for a, b in li:
    ans += b
    if k <= ans:
        print(a)
        break

n, k = list(map(int, input().split()))
li = []
for _ in range(n):
    a, b = list(map(int, input().split()))
    li.append([a, b])
li.sort()
for a, b in li:
    k -= b
    if k <= 0:
        print(a)
        break

-ans = 0 -    ans += b -    if k <= ans: +    k -= b +    if k <= 0: