import io.StdIn.readLine
import annotation.tailrec

object Main extends App {
  val (n, k) = readLine.split(" ") match {
    case Array(n, k) => (n.toInt, k.toLong)
  }
  val abs = List.fill(n)(readLine.split(" ").map(_.toInt) match {
    case Array(a, b) => (a, b)
  })

  println(solve(k, abs))

  @tailrec def solve(k: Long, abs: List[(Int, Int)]): Int = {
    val (a, b) = abs.head
    if (k <= b) a else solve(k - b, abs.tail)
  }
}
