from collections import defaultdict

def main():

    n, k = list(map(int, input().split()))

    d = defaultdict(int)

    for _ in range(n):

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

        d[a] += b

    A = sorted(list(d.items()), key = lambda x: x[0])

    count = 0

    for a in A:

        count += a[1]

        if count >= k:

            print((a[0]))

            exit()



if __name__ == '__main__':

    main()

from collections import defaultdict

def main():

    n, k = list(map(int, input().split()))

    D = defaultdict(int)

    for _ in range(n):

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

        D[a] += b

    for d in sorted(list(D.items()), key = lambda x: x[0]):

        k -= d[1]

        if k <= 0:

            print((d[0]))

            break



if __name__ == '__main__':

    main()

from collections import defaultdict


def main():
    n, k = list(map(int, input().split()))
    d = defaultdict(int)
    for _ in range(n):
        a, b = list(map(int, input().split()))
        d[a] += b
    A = sorted(list(d.items()), key=lambda x: x[0])
    count = 0
    for a in A:
        count += a[1]
        if count >= k:
            print((a[0]))
            exit()


if __name__ == "__main__":
    main()

from collections import defaultdict


def main():
    n, k = list(map(int, input().split()))
    D = defaultdict(int)
    for _ in range(n):
        a, b = list(map(int, input().split()))
        D[a] += b
    for d in sorted(list(D.items()), key=lambda x: x[0]):
        k -= d[1]
        if k <= 0:
            print((d[0]))
            break


if __name__ == "__main__":
    main()

-    d = defaultdict(int) +    D = defaultdict(int) -        d[a] += b -    A = sorted(list(d.items()), key=lambda x: x[0]) -    count = 0 -    for a in A: -        count += a[1] -        if count >= k: -            print((a[0])) -            exit() +        D[a] += b +    for d in sorted(list(D.items()), key=lambda x: x[0]): +        k -= d[1] +        if k <= 0: +            print((d[0])) +            break