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

ab=[]

for _ in range(N):

    ab.append(tuple(map(int, input().split())))

ab=sorted(ab, key=lambda x:x[0])

#print(ab)

accum=[0]

for i in range(len(ab)):

    accum.append(accum[i]+ab[i][1])

#print(accum)

for i in range(len(ab)):

    #print(accum[i], accum[i+1])

    if accum[i] < K <= accum[i+1]:

        print((ab[i][0]))

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

ab=[]

for _ in range(N):

    ab.append(tuple(map(int, input().split())))



num=[0]*(10**5+1)

for el in ab:

    num[el[0]]+=el[1]

#print(num)

count=0

for i in range(10**5+1):

    count+=num[i]

    if count>=K:

        print(i)

        break

N, K = list(map(int, input().split()))
ab = []
for _ in range(N):
    ab.append(tuple(map(int, input().split())))
ab = sorted(ab, key=lambda x: x[0])
# print(ab)
accum = [0]
for i in range(len(ab)):
    accum.append(accum[i] + ab[i][1])
# print(accum)
for i in range(len(ab)):
    # print(accum[i], accum[i+1])
    if accum[i] < K <= accum[i + 1]:
        print((ab[i][0]))
        break

N, K = list(map(int, input().split()))
ab = []
for _ in range(N):
    ab.append(tuple(map(int, input().split())))
num = [0] * (10**5 + 1)
for el in ab:
    num[el[0]] += el[1]
# print(num)
count = 0
for i in range(10**5 + 1):
    count += num[i]
    if count >= K:
        print(i)
        break

-ab = sorted(ab, key=lambda x: x[0]) -# print(ab) -accum = [0] -for i in range(len(ab)): -    accum.append(accum[i] + ab[i][1]) -# print(accum) -for i in range(len(ab)): -    # print(accum[i], accum[i+1]) -    if accum[i] < K <= accum[i + 1]: -        print((ab[i][0])) +num = [0] * (10**5 + 1) +for el in ab: +    num[el[0]] += el[1] +# print(num) +count = 0 +for i in range(10**5 + 1): +    count += num[i] +    if count >= K: +        print(i)