package main

import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
  "container/heap"
)

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  var line, buffer []byte
  var isPrefix bool = true
  var err error
  for isPrefix {
    line, isPrefix, err = reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
  }
  return string(buffer)
}
func NextInt() int {
  var n int
  n, _ = strconv.Atoi(NextLine())
  return n
}
func NextIntVec() []int {
  L := strings.Split(NextLine(), " ")
  N := make([]int, len(L))
  for i := range N {
    N[i], _ = strconv.Atoi(L[i])
  }
  return N
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func Output() {
  _ = writer.Flush()
}

type Item struct {
  Comparison  int
  Index       int
  Value	      int
}
type PriorityQueue []*Item
func (pq PriorityQueue) Len() int { return len(pq) }
func (pq PriorityQueue) Less(i, j int) bool {
  return pq[i].Comparison < pq[j].Comparison
}
func (pq PriorityQueue) Swap(i, j int) {
  pq[i], pq[j] = pq[j], pq[i]
}
func (pq *PriorityQueue) Pop() interface{} {
  old := *pq
  n := len(old)
  item := old[n - 1]
  *pq = old[0:n - 1]
  return item
}
func (pq *PriorityQueue) Push(x interface{}) {
  item := x.(*Item)
  *pq = append(*pq, item)
}

type Evaluator func(a, b interface{}) interface{}
func Min(a, b interface{}) interface{} {
  x := a.(int)
  y := b.(int)
  if x < y { return x }
  return y
}
type SegmentTree struct {
  size  int
  data  []interface{}
  inf   interface{}
  eval  Evaluator
}
func CreateSegmentTree(A *[]interface{}, inf interface{}, eval Evaluator) *SegmentTree {
  N := len((*A))
  size := 1
  for size < N {
    size *= 2
  }
  S := make([]interface{}, size * 2)
  for i, a := range (*A) {
    S[size + i] = a
  }
  for i := N; i < size; i++ {
    S[size + i] = inf
  }
  for i := size - 1; i > 0; i-- {
    S[i] = eval(S[2 * i], S[2 * i + 1])
  }
  return &SegmentTree{
    size: size,
    data: S,
    inf:  inf,
    eval: eval,
  }
}
func (ST *SegmentTree) Update(index int, value interface{}) {
  idx := ST.size + index
  ST.data[idx] = value
  for idx > 1 {
    parent := idx / 2
    ST.data[parent] = ST.eval(ST.data[2 * parent], ST.data[2 * parent + 1])
    idx = parent
  }
}
func (ST *SegmentTree) GetMin(index int) interface{} {
  if index <= ST.size { return ST.data[index] }
  if ST.data[index] == C { return ST.data[index] }
  return ST.eval(ST.GetMin(index * 2), ST.GetMin(index * 2 + 1))
}

const C = 1000000001

func main() {
  NQ := NextIntVec()
  N := NQ[0]
  Q := NQ[1]
  var PQ PriorityQueue
  S := make([]interface{}, N)
  for i := range S {
    S[i] = interface{}(C)
  }
  ST := CreateSegmentTree(&S, interface{}(C), Min)
  for i := 0; i < N; i++ {
    STX := NextIntVec()
    S := STX[0]
    T := STX[1]
    X := STX[2]
    heap.Push(&PQ, &Item{2 * (S - X) - 1, i, X})
    heap.Push(&PQ, &Item{2 * (T - X) - 1, i, C})
  }
  A := make([]string, Q)
  for i:= range A {
    D := NextInt()
    heap.Push(&PQ, &Item{2 * D, i, i})
  }
  for len(PQ) > 0 {
    e := heap.Pop(&PQ).(*Item)
    if e.Comparison % 2 == 0 {
      l := ST.GetMin(1).(int)
      if l == C { l = -1 }
      A[e.Index] = strconv.Itoa(l)
    } else {
      ST.Update(e.Index, interface{}(e.Value))
    }
  }
  Write(strings.Join(A, "\n"))
  Output()
}

Measured memory_bytes: 100080