object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N, Q = sc.nextInt
  val STXs = Seq.fill(N)(sc.nextInt, sc.nextInt, sc.nextInt)
  val Ds = Seq.fill(Q)(sc.nextInt)

  val es = (STXs.flatMap{case(s, t, x) => Seq((s - x - 0.5, 1, x), (t - x - 0.5, -1, x))} ++ Ds.map{d => (d.toDouble, 0, 0) }).sortBy{t => t._1}
  val s = collection.mutable.SortedSet.empty[Int]
  for(t <- es) t match{
    case(t, 1, x)  => s += x
    case(t, -1, x) => s -= x
    case(d, 0, _)  => println(s.headOption.getOrElse(-1))
  }
}