from collections import Counter



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

input_list = [[int(i) for i in input().split()] for j in range(N)]

input_list.sort()



input_counter = Counter()



for element in input_list:

    input_counter[element[0]] += element[1]



for element in input_list:

    K -= element[1]

    if K <= 0:

        print((element[0]))

        break
from collections import Counter



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

input_list = [[int(i) for i in input().split()] for j in range(N)]

input_list.sort()



for element in input_list:

    K -= element[1]

    if K <= 0:

        print((element[0]))

        break
from collections import Counter

N, K = list(map(int, input().split()))
input_list = [[int(i) for i in input().split()] for j in range(N)]
input_list.sort()
input_counter = Counter()
for element in input_list:
    input_counter[element[0]] += element[1]
for element in input_list:
    K -= element[1]
    if K <= 0:
        print((element[0]))
        break

from collections import Counter

N, K = list(map(int, input().split()))
input_list = [[int(i) for i in input().split()] for j in range(N)]
input_list.sort()
for element in input_list:
    K -= element[1]
    if K <= 0:
        print((element[0]))
        break

-input_counter = Counter() -for element in input_list: -    input_counter[element[0]] += element[1]