from bisect import bisect_left,bisect_right

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

table=[]

for i in range(N):

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

    table.append([a,b])

table.sort()

cou=[0]*N

cou[0]=table[0][1]

for i in range(1,N):

    cou[i]=cou[i-1]+table[i][1]

s = bisect_left(cou,K)

print((table[s][0]))
N,K=list(map(int,input().split()))

table=[]

for i in range(N):

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

    table.append([a,b])

table.sort()

ans = 0

for x,y in table:

    ans += y

    if ans >=K:

        print(x)

        break
from bisect import bisect_left, bisect_right

N, K = list(map(int, input().split()))
table = []
for i in range(N):
    a, b = list(map(int, input().split()))
    table.append([a, b])
table.sort()
cou = [0] * N
cou[0] = table[0][1]
for i in range(1, N):
    cou[i] = cou[i - 1] + table[i][1]
s = bisect_left(cou, K)
print((table[s][0]))

N, K = list(map(int, input().split()))
table = []
for i in range(N):
    a, b = list(map(int, input().split()))
    table.append([a, b])
table.sort()
ans = 0
for x, y in table:
    ans += y
    if ans >= K:
        print(x)
        break

-from bisect import bisect_left, bisect_right - -cou = [0] * N -cou[0] = table[0][1] -for i in range(1, N): -    cou[i] = cou[i - 1] + table[i][1] -s = bisect_left(cou, K) -print((table[s][0])) +ans = 0 +for x, y in table: +    ans += y +    if ans >= K: +        print(x) +        break