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

sum_b = 0

ab_list = []



for i in range(n):

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



ab_list.sort()

for i in range(n):

    a, b = ab_list[i]

    sum_b += b

    if sum_b >= k:

        print(a)

        break

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

bucket = [0] * 10 ** 5

for i in range(n):

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

    bucket[a - 1] += b



sum_b = 0

for i in range(len(bucket)):

    sum_b += bucket[i]

    if sum_b >= k:

        print((i + 1))

        break

n, k = list(map(int, input().split()))
sum_b = 0
ab_list = []
for i in range(n):
    ab_list.append(list(map(int, input().split())))
ab_list.sort()
for i in range(n):
    a, b = ab_list[i]
    sum_b += b
    if sum_b >= k:
        print(a)
        break

n, k = list(map(int, input().split()))
bucket = [0] * 10**5
for i in range(n):
    a, b = list(map(int, input().split()))
    bucket[a - 1] += b
sum_b = 0
for i in range(len(bucket)):
    sum_b += bucket[i]
    if sum_b >= k:
        print((i + 1))
        break

+bucket = [0] * 10**5 +for i in range(n): +    a, b = list(map(int, input().split())) +    bucket[a - 1] += b -ab_list = [] -for i in range(n): -    ab_list.append(list(map(int, input().split()))) -ab_list.sort() -for i in range(n): -    a, b = ab_list[i] -    sum_b += b +for i in range(len(bucket)): +    sum_b += bucket[i] -        print(a) +        print((i + 1))