from collections import defaultdict
n, k = map(int, input().split())
ans = 0
al = []
d = defaultdict(int)
for i in range(n):
    a, b = map(int, input().split())
    al.append(a)
    d[a] += b
al = list(set(al))
al.sort()
for i in al:
    if k > d[i]:
        k -= d[i]
    else:
        print(i)
        break

9eb3abdd6932845a420901c0f52123f089023a10
<mask token>

<mask token>
for i in range(n):
    a, b = map(int, input().split())
    al.append(a)
    d[a] += b
<mask token>
al.sort()
for i in al:
    if k > d[i]:
        k -= d[i]
    else:
        print(i)
        break

<mask token>
n, k = map(int, input().split())
ans = 0
al = []
d = defaultdict(int)
for i in range(n):
    a, b = map(int, input().split())
    al.append(a)
    d[a] += b
al = list(set(al))
al.sort()
for i in al:
    if k > d[i]:
        k -= d[i]
    else:
        print(i)
        break

from collections import defaultdict
n, k = map(int, input().split())
ans = 0
al = []
d = defaultdict(int)
for i in range(n):
    a, b = map(int, input().split())
    al.append(a)
    d[a] += b
al = list(set(al))
al.sort()
for i in al:
    if k > d[i]:
        k -= d[i]
    else:
        print(i)
        break
