import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer


object Main {


  case class Construction(s: Long, t: Long, x: Long)

  case class ValuedRange(begin: Long, end: Long, v: Long)


  def read() = {
    val input = io.Source.stdin.getLines()
    val Array(n, q) = input.next().split(" ").map(_.toInt)
    val conss = IndexedSeq.fill(n) {
      val strs = input.next().split(" ")
      Construction(strs(0).toLong, strs(1).toLong, strs(2).toLong)
    }
    val people = IndexedSeq.fill(q) {
      input.next().toLong
    }
    (n, q, conss, people)
  }


  def solve2(n: Int, q: Int, conss: IndexedSeq[Construction], people: IndexedSeq[Long]): IndexedSeq[Long] = {
    val inf = 1e10.toLong
    val ranges = IndexedSeq.concat(
      conss.map(cons => ValuedRange(cons.s - cons.x, cons.t - cons.x, cons.x)),
      IndexedSeq(ValuedRange(-inf, inf, inf))
    ) //inf入れなくて良さそう

    sealed trait EventKind
    case object Addition extends EventKind
    case object Deletion extends EventKind

    case class Event(pos: Long, v: Long, kind: EventKind)


    val eventQueue = mutable.PriorityQueue[Event]()(
      Ordering.by[Event, Long](x => x.pos).reverse
    )

    for (range <- ranges) {
      eventQueue.+=(Event(range.begin, range.v, Addition))
      eventQueue.+=(Event(range.end, range.v, Deletion))
    }


    val result = ArrayBuffer.empty[Long]
    val vSet = mutable.Set.empty[Long]

    def doEvent(event: Event): Unit = {
      if (event.kind == Addition) {
        vSet.+=(event.v)
      } else if (event.kind == Deletion) {
        vSet.-=(event.v)
      }
    }


    for (pPos <- people) {
      while (pPos >= eventQueue.head.pos) {
        doEvent(eventQueue.dequeue())
      }
      result.append(vSet.min)
    }

    result.map(x => if (x == inf) -1L else x).toIndexedSeq
  }

  def output(result: IndexedSeq[Long]) = {
    val out = new java.io.PrintWriter(System.out)
    result.foreach(out.println)
    out.flush()
  }

  def main(args: Array[String]): Unit = {
    val (n, q, conss, people) = read()
    output(solve2(n, q, conss, people))
  }
}