object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val k = sc.nextLong()
  val ab = List.fill(n)((sc.nextInt(), sc.nextLong())).sorted
  val c = ab.scanLeft((-1, 0L)){case ((_, sum), (a, b)) =>(a, sum + b)}
  val ans = c.find{case (_, sum) => k <= sum}.get._1
  println(ans)
}