'use strict'

function main(input) {
  input = input.split('\n').map(v => v.split(' ').map(v => ~~v))
  const n = input[0][0]
  const k = input[0][1]

  let xxx = input.slice(1, input.length).sort((a, b) => {
    if (a[0] < b[0]) return -1
    if (a[0] > b[0]) return 1
    if (a[1] < b[1]) return -1
    if (a[1] > b[1]) return 1
    return 0
  })

  let stack = 0
  for (let i = 0; i < n; i++) {
    stack += xxx[i][1]

    if (stack > k) {
      console.log(xxx[i][0])
      return
    }
  }

  // console.log(xxx[0], xxx[1], xxx[2])

  // console.log('-------')
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))