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

S = [list(map(int, input().split())) for _ in range(N)]



from operator import itemgetter

S.sort(key=itemgetter(0)) 



#timesは今何番目に大きいものを表しているか

times=0

#indexは今のインデックス

index=0



while True:

    hoge = times+S[index][1]

    if hoge < K:

        times += S[index][1]

    else:

        re =S[index][0]

        break

    index += 1



print(re)

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

li=[0]*100001



for i in range(N):

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

    li[a] += b



tmp=0

for i in range(100001):

    tmp += li[i]

    if tmp >= K:

        print(i)

        break
N, K = list(map(int, input().split()))
S = [list(map(int, input().split())) for _ in range(N)]
from operator import itemgetter

S.sort(key=itemgetter(0))
# timesは今何番目に大きいものを表しているか
times = 0
# indexは今のインデックス
index = 0
while True:
    hoge = times + S[index][1]
    if hoge < K:
        times += S[index][1]
    else:
        re = S[index][0]
        break
    index += 1
print(re)

N, K = list(map(int, input().split()))
li = [0] * 100001
for i in range(N):
    a, b = list(map(int, input().split()))
    li[a] += b
tmp = 0
for i in range(100001):
    tmp += li[i]
    if tmp >= K:
        print(i)
        break

-S = [list(map(int, input().split())) for _ in range(N)] -from operator import itemgetter - -S.sort(key=itemgetter(0)) -# timesは今何番目に大きいものを表しているか -times = 0 -# indexは今のインデックス -index = 0 -while True: -    hoge = times + S[index][1] -    if hoge < K: -        times += S[index][1] -    else: -        re = S[index][0] +li = [0] * 100001 +for i in range(N): +    a, b = list(map(int, input().split())) +    li[a] += b +tmp = 0 +for i in range(100001): +    tmp += li[i] +    if tmp >= K: +        print(i) -    index += 1 -print(re)