import io.StdIn.readLine
object Main extends App {
  val Array(n, k) = readLine.split(" ").map(_.toLong)

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