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

ab = {}

for _ in range(n):

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

    ab.setdefault(a, 0)

    ab[a] += b

keys = list(ab.keys())

keys.sort()

i = 0

for key in keys:

    i += ab[key]

    if i >= k:

        print(key)

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

A_MAX = 10**5

bkt = [0 for _ in range(A_MAX+1)]

for _ in range(n):

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

    bkt[a] += b

sum_count = 0

for i, cnt in enumerate(bkt):

    sum_count += cnt

    if sum_count >= k:

        print(i)

        break
n, k = list(map(int, input().split()))
ab = {}
for _ in range(n):
    a, b = list(map(int, input().split()))
    ab.setdefault(a, 0)
    ab[a] += b
keys = list(ab.keys())
keys.sort()
i = 0
for key in keys:
    i += ab[key]
    if i >= k:
        print(key)
        break

n, k = list(map(int, input().split()))
A_MAX = 10**5
bkt = [0 for _ in range(A_MAX + 1)]
for _ in range(n):
    a, b = list(map(int, input().split()))
    bkt[a] += b
sum_count = 0
for i, cnt in enumerate(bkt):
    sum_count += cnt
    if sum_count >= k:
        print(i)
        break

-ab = {} +A_MAX = 10**5 +bkt = [0 for _ in range(A_MAX + 1)] -    ab.setdefault(a, 0) -    ab[a] += b -keys = list(ab.keys()) -keys.sort() -i = 0 -for key in keys: -    i += ab[key] -    if i >= k: -        print(key) +    bkt[a] += b +sum_count = 0 +for i, cnt in enumerate(bkt): +    sum_count += cnt +    if sum_count >= k: +        print(i)