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

d = {}

for i in range(N):

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

    if a in d:

        d[a]=d[a]+b

    else:

        d.setdefault(a,b)



d = sorted(list(d.items()))



for i in range(len(d)):

    K = K - d[i][1]

    if K <= 0:

        print((d[i][0]))

        break
from collections import defaultdict as dd

import sys

input = sys.stdin.readline



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



d = dd(int)

for i in range(N):

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

    d[a] += b



d = sorted(d.items())

for i,j in d:

    K -= j

    if K <= 0:

        print(i)

        break
N, K = list(map(int, input().split()))
d = {}
for i in range(N):
    a, b = list(map(int, input().split()))
    if a in d:
        d[a] = d[a] + b
    else:
        d.setdefault(a, b)
d = sorted(list(d.items()))
for i in range(len(d)):
    K = K - d[i][1]
    if K <= 0:
        print((d[i][0]))
        break

from collections import defaultdict as dd
import sys

input = sys.stdin.readline
N, K = list(map(int, input().split()))
d = dd(int)
for i in range(N):
    a, b = list(map(int, input().split()))
    d[a] += b
d = sorted(d.items())
for i, j in d:
    K -= j
    if K <= 0:
        print(i)
        break

+from collections import defaultdict as dd +import sys + +input = sys.stdin.readline -d = {} +d = dd(int) -    if a in d: -        d[a] = d[a] + b -    else: -        d.setdefault(a, b) -d = sorted(list(d.items())) -for i in range(len(d)): -    K = K - d[i][1] +    d[a] += b +d = sorted(d.items()) +for i, j in d: +    K -= j -        print((d[i][0])) +        print(i)