def inpl(): return input().split()

n, k = list(map(int, inpl()))

M = list(list(map(int, inpl())) for _ in range(n))

M = sorted(M, key=lambda x:x[0])

for i in range(n):

    a, b = M[i]

    if k <= b:

        print(a)

        exit()

    else:

        k -= b
def main():

    from heapq import heappush, heappop



    import sys

    input = sys.stdin.readline



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



    h = []

    for _ in range(N):

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

        heappush(h, (a, b))



    while h:

        a, b = heappop(h)

        K -= b

        if K <= 0:

            print(a)

            return





if __name__ == '__main__':

    main()

def inpl():
    return input().split()


n, k = list(map(int, inpl()))
M = list(list(map(int, inpl())) for _ in range(n))
M = sorted(M, key=lambda x: x[0])
for i in range(n):
    a, b = M[i]
    if k <= b:
        print(a)
        exit()
    else:
        k -= b

def main():
    from heapq import heappush, heappop
    import sys

    input = sys.stdin.readline
    N, K = list(map(int, input().split()))
    h = []
    for _ in range(N):
        a, b = list(map(int, input().split()))
        heappush(h, (a, b))
    while h:
        a, b = heappop(h)
        K -= b
        if K <= 0:
            print(a)
            return


if __name__ == "__main__":
    main()

-def inpl(): -    return input().split() +def main(): +    from heapq import heappush, heappop +    import sys + +    input = sys.stdin.readline +    N, K = list(map(int, input().split())) +    h = [] +    for _ in range(N): +        a, b = list(map(int, input().split())) +        heappush(h, (a, b)) +    while h: +        a, b = heappop(h) +        K -= b +        if K <= 0: +            print(a) +            return -n, k = list(map(int, inpl())) -M = list(list(map(int, inpl())) for _ in range(n)) -M = sorted(M, key=lambda x: x[0]) -for i in range(n): -    a, b = M[i] -    if k <= b: -        print(a) -        exit() -    else: -        k -= b +if __name__ == "__main__": +    main()