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

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

ab.sort()

check = 0

for i in range(N):

    check += ab[i][1]

    if K <= check:

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

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

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

ab.sort()

check = 0

for a, b in ab:

    check += b

    if check >= K:

        print(a)

        break
N, K = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(N)]
ab.sort()
check = 0
for i in range(N):
    check += ab[i][1]
    if K <= check:
        print((ab[i][0]))
        break

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

-ab = [list(map(int, input().split())) for i in range(N)] +ab = [[int(i) for i in input().split()] for i in range(N)] -for i in range(N): -    check += ab[i][1] -    if K <= check: -        print((ab[i][0])) +for a, b in ab: +    check += b +    if check >= K: +        print(a)