N, K = list(map(int, input().split()))

a = [0] * N

b = [0] * N



for i in range(N):

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



a, b = list(zip(*sorted(zip(a, b))))



count = 0

while K > 0:

    K -= b[count]

    count += 1



print((a[count - 1]))
import sys

input = sys.stdin.readline



N, K = list(map(int, input().split()))

a = [0] * N

b = [0] * N



for i in range(N):

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



a, b = list(zip(*sorted(zip(a, b))))



count = 0

while K > 0:

    K -= b[count]

    count += 1



print((a[count - 1]))
N, K = list(map(int, input().split()))
a = [0] * N
b = [0] * N
for i in range(N):
    a[i], b[i] = list(map(int, input().split()))
a, b = list(zip(*sorted(zip(a, b))))
count = 0
while K > 0:
    K -= b[count]
    count += 1
print((a[count - 1]))

import sys

input = sys.stdin.readline
N, K = list(map(int, input().split()))
a = [0] * N
b = [0] * N
for i in range(N):
    a[i], b[i] = list(map(int, input().split()))
a, b = list(zip(*sorted(zip(a, b))))
count = 0
while K > 0:
    K -= b[count]
    count += 1
print((a[count - 1]))

+import sys + +input = sys.stdin.readline