import sys

from collections import Counter



def solve():

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

    cntr = Counter()



    for i in range(N):

        ai, bi = list(map(int, sys.stdin.readline().split()))

        cntr[ai] += bi



    cntr = sorted(cntr.items())

    # print(cntr)



    cnt = 0



    for a, b in cntr:

        cnt += b



        if cnt >= K:

            print(a)

            return





if __name__ == '__main__':

    solve()
import sys



def solve():

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



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



    for i in range(N):

        ai, bi = list(map(int, sys.stdin.readline().split()))

        cnt[ai] += bi



    tot = 0



    for i, cnti in enumerate(cnt):

        tot += cnti



        if tot >= K:

            print(i)

            return



if __name__ == '__main__':

    solve()
import sys
from collections import Counter


def solve():
    N, K = list(map(int, input().split()))
    cntr = Counter()
    for i in range(N):
        ai, bi = list(map(int, sys.stdin.readline().split()))
        cntr[ai] += bi
    cntr = sorted(cntr.items())
    # print(cntr)
    cnt = 0
    for a, b in cntr:
        cnt += b
        if cnt >= K:
            print(a)
            return


if __name__ == "__main__":
    solve()

import sys


def solve():
    N, K = list(map(int, input().split()))
    cnt = [0] * (10**5 + 1)
    for i in range(N):
        ai, bi = list(map(int, sys.stdin.readline().split()))
        cnt[ai] += bi
    tot = 0
    for i, cnti in enumerate(cnt):
        tot += cnti
        if tot >= K:
            print(i)
            return


if __name__ == "__main__":
    solve()

-from collections import Counter -    cntr = Counter() +    cnt = [0] * (10**5 + 1) -        cntr[ai] += bi -    cntr = sorted(cntr.items()) -    # print(cntr) -    cnt = 0 -    for a, b in cntr: -        cnt += b -        if cnt >= K: -            print(a) +        cnt[ai] += bi +    tot = 0 +    for i, cnti in enumerate(cnt): +        tot += cnti +        if tot >= K: +            print(i)