'use strict'

main()

function main (input) {
  readInput()
  .then(parseInput)
  .then(calc)
}

function calc (input) {
  let n = input[0][0]
  let k = input[0][1]
  let operations = new Array(n).fill(0).map(
    (_, i) => ({ a: input[i + 1][0], b: input[i + 1][1] })
  )
  operations.sort((one, another) => one.a - another.a)
  for (let op of operations) {
    let a = op.a
    let b = op.b
    if (k > b) {
      k -= b
    } else {
      console.log(a)
      return
    }
  }
}

function parseInput (inputRaw) {
  let input = inputRaw.split('\n').map(row => row.split(' ').map(Number))
  return input
}

function readInput () {
  return new Promise((resolve) => {
    let inputArr = []
    process.stdin.resume()
    process.stdin.setEncoding('utf8')
    process.stdin.on('data', (chunk) => {
      inputArr.push(chunk)
    })
    process.stdin.on('end', () => {
      let input = inputArr.join('').trim()
      resolve(input)
    })
  })
}
