from collections import defaultdict



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

d=defaultdict(int)

for i in range(n):

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

    d[a]+=b

l=sorted(d.keys())

cnt=0

for i in l:

    cnt+=d[i]

    if cnt>=k:

        print(i)

        exit()
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]+=b

  else:

    d[a]=b



d_keys=sorted(d.keys())

cnt=0

for i in d_keys:

  cnt+=d[i]

  if cnt>=k:

    print(i)

    exit()
from collections import defaultdict

n, k = list(map(int, input().split()))
d = defaultdict(int)
for i in range(n):
    a, b = list(map(int, input().split()))
    d[a] += b
l = sorted(d.keys())
cnt = 0
for i in l:
    cnt += d[i]
    if cnt >= k:
        print(i)
        exit()

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] += b
    else:
        d[a] = b
d_keys = sorted(d.keys())
cnt = 0
for i in d_keys:
    cnt += d[i]
    if cnt >= k:
        print(i)
        exit()

-from collections import defaultdict - -d = defaultdict(int) +d = {} -    d[a] += b -l = sorted(d.keys()) +    if a in d: +        d[a] += b +    else: +        d[a] = b +d_keys = sorted(d.keys()) -for i in l: +for i in d_keys: