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

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

for e in L:

    K -= e[1]

    if K <= 0:

        print((e[0]))

        exit(0)

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

L = []

for k in range(N):

    L.append(list(map(int,input().split())))

L = sorted(L)

for e in L:

    K -= e[1]

    if K <= 0:

        print((e[0]))

        exit(0)

N, K = list(map(int, input().split()))
L = sorted([list(map(int, input().split())) for _ in range(N)])
for e in L:
    K -= e[1]
    if K <= 0:
        print((e[0]))
        exit(0)

N, K = list(map(int, input().split()))
L = []
for k in range(N):
    L.append(list(map(int, input().split())))
L = sorted(L)
for e in L:
    K -= e[1]
    if K <= 0:
        print((e[0]))
        exit(0)

-L = sorted([list(map(int, input().split())) for _ in range(N)]) +L = [] +for k in range(N): +    L.append(list(map(int, input().split()))) +L = sorted(L)