import sys

from operator import itemgetter

input = sys.stdin.readline  # NOQA





def main():

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

    ab = [None] * N

    for i in range(N):

        ab[i] = tuple(map(int, input().split()))



    ab.sort(key=itemgetter(0))

    

    cnt = 0

    for a, b in ab:

        cnt += b

        if cnt >= K:

            ans = a

            break

    print(ans)





if __name__ == "__main__":

    main()

import sys

input = sys.stdin.readline  # NOQA





def main():

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

    cnt = [0] * (1 + 10**5)



    for i in range(N):

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

        cnt[a] += b



    total = 0

    for i in range(1, 10**5 + 1):

        total += cnt[i]

        if total >= K:

            ans = i

            break

    print(ans)





if __name__ == "__main__":

    main()

import sys
from operator import itemgetter

input = sys.stdin.readline  # NOQA


def main():
    N, K = list(map(int, input().split()))
    ab = [None] * N
    for i in range(N):
        ab[i] = tuple(map(int, input().split()))
    ab.sort(key=itemgetter(0))
    cnt = 0
    for a, b in ab:
        cnt += b
        if cnt >= K:
            ans = a
            break
    print(ans)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline  # NOQA


def main():
    N, K = list(map(int, input().split()))
    cnt = [0] * (1 + 10**5)
    for i in range(N):
        a, b = list(map(int, input().split()))
        cnt[a] += b
    total = 0
    for i in range(1, 10**5 + 1):
        total += cnt[i]
        if total >= K:
            ans = i
            break
    print(ans)


if __name__ == "__main__":
    main()

-from operator import itemgetter -    ab = [None] * N +    cnt = [0] * (1 + 10**5) -        ab[i] = tuple(map(int, input().split())) -    ab.sort(key=itemgetter(0)) -    cnt = 0 -    for a, b in ab: -        cnt += b -        if cnt >= K: -            ans = a +        a, b = list(map(int, input().split())) +        cnt[a] += b +    total = 0 +    for i in range(1, 10**5 + 1): +        total += cnt[i] +        if total >= K: +            ans = i