function model(cost, time) {
  return {cost, time}
}

function main(input) {

  const lines = input.split('\n');
  const timeLimit = parseInt(lines.shift().split(' ')[1], 10)

  let minCost = 9999999;

  lines.map(line => {
    const cost = line.split(' ')[0]
    const time = line.split(' ')[1]
    return model(cost, time)
  }).forEach((p) => {
    if(parseInt(p.time, 10) > timeLimit) {
      return
    }
    if(parseInt(p.cost, 10) < minCost) {
      minCost = parseInt(p.cost, 10);
    }
  })
  console.log(minCost);
}

    // main(require('fs').readFileSync('/dev/stdin', 'utf8'));
