'use strict'

function Main(input) {
  const arr = input.split('\n');
  const tmp = arr[0].split(' ');
  const N = parseInt(tmp[0], 10);
  const K = parseInt(tmp[1], 10);

  let bigArr = [];
  for (let i = 1; i <= N; i++) {
    const t = arr[i].split(' ');
    const num = parseInt(t[0], 10);
    const cnt = parseInt(t[1], 10);
    for (let j = 0; j < cnt; j++) {
      bigArr.push(num);
    }
  }
  bigArr.sort((a, b) => a - b);
  console.log(bigArr[K - 1]);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
