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

num = []

for i in range(n):

    num.append(list(map(int, input().split())))

num.sort()

summ = 0

for i in range(len(num)):

    if k <= summ + num[i][1]:

        print((num[i][0]))

        exit()

    else:

        summ += num[i][1]
from collections import defaultdict

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

s = defaultdict(int)

for j in range(n):

    i, v = list(map(int, input().split()))

    s[i] += v

f = sorted(s.items())

tmp = 0

for g in f:

    tmp += g[1]

    if tmp >= k:

        print((g[0]))

        exit()

n, k = list(map(int, input().split()))
num = []
for i in range(n):
    num.append(list(map(int, input().split())))
num.sort()
summ = 0
for i in range(len(num)):
    if k <= summ + num[i][1]:
        print((num[i][0]))
        exit()
    else:
        summ += num[i][1]

from collections import defaultdict

n, k = list(map(int, input().split()))
s = defaultdict(int)
for j in range(n):
    i, v = list(map(int, input().split()))
    s[i] += v
f = sorted(s.items())
tmp = 0
for g in f:
    tmp += g[1]
    if tmp >= k:
        print((g[0]))
        exit()

+from collections import defaultdict + -num = [] -for i in range(n): -    num.append(list(map(int, input().split()))) -num.sort() -summ = 0 -for i in range(len(num)): -    if k <= summ + num[i][1]: -        print((num[i][0])) +s = defaultdict(int) +for j in range(n): +    i, v = list(map(int, input().split())) +    s[i] += v +f = sorted(s.items()) +tmp = 0 +for g in f: +    tmp += g[1] +    if tmp >= k: +        print((g[0])) -    else: -        summ += num[i][1]