(N, K), *AB = [list(map(int, s.split())) for s in open(0)]

for a, b in sorted(AB):

    K -= b

    if K <= 0:

        print(a)

        break

N, K, *AB = list(map(int, open(0).read().split()))

li = [(a, b) for a, b in zip(*[iter(AB)] * 2)]

li.sort()

for a, b in li:

    if K > b:

        K -= b

    else:

        print(a)

        break

(N, K), *AB = [list(map(int, s.split())) for s in open(0)]
for a, b in sorted(AB):
    K -= b
    if K <= 0:
        print(a)
        break

N, K, *AB = list(map(int, open(0).read().split()))
li = [(a, b) for a, b in zip(*[iter(AB)] * 2)]
li.sort()
for a, b in li:
    if K > b:
        K -= b
    else:
        print(a)
        break

-(N, K), *AB = [list(map(int, s.split())) for s in open(0)] -for a, b in sorted(AB): -    K -= b -    if K <= 0: +N, K, *AB = list(map(int, open(0).read().split())) +li = [(a, b) for a, b in zip(*[iter(AB)] * 2)] +li.sort() +for a, b in li: +    if K > b: +        K -= b +    else: