# -*- coding: utf-8 -*-

line = input().split(" ")

n = int(line[0])

k = int(line[1])



l = []

for _ in range(n):

    line = input().split(" ")

    a = int(line[0])

    b = int(line[1])

    l.append([a,b])



l.sort()



while k>0:

    x = l.pop(0)

    k = k-x[1]



print((x[0]))

# -*- coding: utf-8 -*-

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



res = 0

for a,b in ab:

    if b>=k:

        res = a

        break

    else:

        k -= b

print(res)

# -*- coding: utf-8 -*-
line = input().split(" ")
n = int(line[0])
k = int(line[1])
l = []
for _ in range(n):
    line = input().split(" ")
    a = int(line[0])
    b = int(line[1])
    l.append([a, b])
l.sort()
while k > 0:
    x = l.pop(0)
    k = k - x[1]
print((x[0]))

# -*- coding: utf-8 -*-
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()
res = 0
for a, b in ab:
    if b >= k:
        res = a
        break
    else:
        k -= b
print(res)

-line = input().split(" ") -n = int(line[0]) -k = int(line[1]) -l = [] +n, k = list(map(int, input().split())) +ab = [] -    line = input().split(" ") -    a = int(line[0]) -    b = int(line[1]) -    l.append([a, b]) -l.sort() -while k > 0: -    x = l.pop(0) -    k = k - x[1] -print((x[0])) +    a, b = list(map(int, input().split())) +    ab.append((a, b)) +ab.sort() +res = 0 +for a, b in ab: +    if b >= k: +        res = a +        break +    else: +        k -= b +print(res)