import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}
import scala.collection.mutable.PriorityQueue

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)


  val N, Q = in.next().toInt
  var section: List[(Int, Int, Int)] = Nil // (time, cost, id)
  for (i <- 1 to N) {
    val s, t, x = in.next().toInt
    val l = s - x
    val r = t - x
    if (r >= 0) {
      section = (l, x, i) :: section
      section = (r, x, i) :: section
    }
  }
  val D = new Array[Int](Q)
  for (i <- 1 to Q) {
    D(i-1) = in.next().toInt
  }


  //
  val hoge: Array[(Int, Int, Int)] = section.toArray.sorted
  val fuga = hoge.length
  var ind = 0

  val start = new PriorityQueue[(Int, Int)] // (cost, id)
  val end = new Array[Boolean](N+1)
  for (i <- 0 until Q) {
    breakable {
      while(ind < fuga) {
        val (time, x, id) = hoge(ind)

        if(time <= D(i)) {
          if (!end(id)) {
            start.enqueue((-x, id))
            end(id) = true
          }
          else
            end(id) = false
          ind += 1
        }
        else
          break
      }
    }

    var ans = -1
    breakable {
      while(!start.isEmpty) {
        val (cost, id) = start.head
        if (end(id)) {
          ans = -cost
          break
        }
        else
          start.dequeue()
      }
    }
    pw.println(ans)
  }
  pw.flush()
}


class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}
