N, K = [int(i) for i in input().split()]

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



L.sort()

k = 0

for a, b in L:

    if k + b >= K:

        print(a)

        quit()

    k += b

N, K = [int(i) for i in input().split()]



memo = [0] * (10 ** 5 + 10)

for _ in range(N):

    a, b = [int(i) for i in input().split()]

    memo[a] += b



for i, b in enumerate(memo):

    if K <= memo[i]:

        print(i)

        quit()

    K -= memo[i]

N, K = [int(i) for i in input().split()]
L = [[int(i) for i in input().split()] for _ in range(N)]
L.sort()
k = 0
for a, b in L:
    if k + b >= K:
        print(a)
        quit()
    k += b

N, K = [int(i) for i in input().split()]
memo = [0] * (10**5 + 10)
for _ in range(N):
    a, b = [int(i) for i in input().split()]
    memo[a] += b
for i, b in enumerate(memo):
    if K <= memo[i]:
        print(i)
        quit()
    K -= memo[i]

-L = [[int(i) for i in input().split()] for _ in range(N)] -L.sort() -k = 0 -for a, b in L: -    if k + b >= K: -        print(a) +memo = [0] * (10**5 + 10) +for _ in range(N): +    a, b = [int(i) for i in input().split()] +    memo[a] += b +for i, b in enumerate(memo): +    if K <= memo[i]: +        print(i) -    k += b +    K -= memo[i]