n, k = map(int, input().split())
ar = {}
for i in range(n):
    a, b = map(int, input().split())
    if (a in ar) == True:
        ar[a] += b
    else:
        ar[a] = b
for i in sorted(ar.keys()):
    k -= ar[i]
    if k <= 0:
        print(i)
        break

b6a06f210fb2519ec723adeb7352378ebde55363
<mask token>

<mask token>
for i in range(n):
    a, b = map(int, input().split())
    if (a in ar) == True:
        ar[a] += b
    else:
        ar[a] = b
for i in sorted(ar.keys()):
    k -= ar[i]
    if k <= 0:
        print(i)
        break

n, k = map(int, input().split())
ar = {}
for i in range(n):
    a, b = map(int, input().split())
    if (a in ar) == True:
        ar[a] += b
    else:
        ar[a] = b
for i in sorted(ar.keys()):
    k -= ar[i]
    if k <= 0:
        print(i)
        break
