package main

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

func COM(n, k int64) int64 {
	r := int64(1)
	for i := int64(0); i < k; i++ {
		r = ModMul(r, n-i)
		r = ModDiv(r, i+1)
	}

	return r
}

const (
	MOD = 1000000000 + 7
)

func ModAdd(a, b int64) int64 {
	return (a + b) % MOD
}

func ModMul(a, b int64) int64 {
	return a * b % MOD
}

func ModSub(a, b int64) int64 {
	r := (a%MOD - b%MOD) % MOD
	if r < 0 {
		r += MOD
	}
	return r
}

func ModDiv(a, b int64) int64 {
	return a % MOD * ModInv(b) % MOD
}

func ModPow(a, n int64) int64 {
	var r int64 = 1
	for n > 0 {
		if n&1 == 1 {
			r = r * a % MOD
		}
		a = a * a % MOD
		n >>= 1
	}
	return r
}

func ModInv(a int64) int64 {
	var b, u, v int64 = MOD, 1, 0
	for b > 0 {
		t := a / b
		a -= t * b
		a, b = b, a
		u -= t * v
		u, v = v, u
	}
	u %= MOD
	if u < 0 {
		u += MOD
	}
	return u
}

type Q struct {
	value int
	index int
	A, B  int
}

type QS []*Q

func (p QS) Len() int           { return len(p) }
func (p QS) Less(i, j int) bool { return p[i].value > p[j].value }
func (pq QS) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *QS) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Q)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *QS) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil  // avoid memory leak
	item.index = -1 // for safety
	*pq = old[0 : n-1]
	return item
}

func FactoredPrimeNumber(num int) map[int]int {
	m := map[int]int{}
	return factor(m, num, 2)
}

func factor(result map[int]int, num, pnum int) map[int]int {
	if pnum*pnum > num {
		if num != 1 {
			result[num] += 1
		}
		return result
	}

	if num%pnum == 0 {
		num /= pnum
		result[pnum]++
	} else {
		pnum++
	}
	return factor(result, num, pnum)
}

func GCD(a, b int64) int64 {
	if b == 0 {
		return a
	}
	return GCD(b, a%b)
}

func LCM(a, b int64) int64 {
	return a * b / GCD(a, b)
}

type P struct {
	X, T, Cond int
}

type PS []*P

func (p PS) Len() int           { return len(p) }
func (p PS) Less(i, j int) bool { return p[i].T < p[j].T }
func (pq PS) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	t := strings.Split(sc.Text(), " ")
	N, _ := strconv.Atoi(t[0])
	Q, _ := strconv.Atoi(t[1])
	events := make(PS, 2*N)
	for i := 0; i < N; i++ {
		sc.Scan()
		text := strings.Split(sc.Text(), " ")
		s, _ := strconv.Atoi(text[0])
		t, _ := strconv.Atoi(text[1])
		x, _ := strconv.Atoi(text[2])
		events[2*i] = &P{X: x, T: s - x, Cond: 1}
		events[2*i+1] = &P{X: x, T: t - x, Cond: -1}
	}
	D := make([]int, Q)
	for i := 0; i < Q; i++ {
		sc.Scan()
		D[i], _ = strconv.Atoi(sc.Text())
	}
	sort.Stable(events)
	pos := 0
	v := IntHeap{}
	heap.Init(&v)
	m := map[int]int{}
	for i := 0; i < Q; i++ {
		d := D[i]
		for pos < len(events) && events[pos].T <= d {
			e := events[pos]
			if e.Cond == 1 {
				heap.Push(&v, e.X)
			} else {
				m[e.X]++
			}
			pos++
		}
		for v.Len() > 0 && m[v[0]] > 0 {
			m[v[0]]--
			heap.Pop(&v)
		}
		if v.Len() > 0 {
			fmt.Println(v[0])
		} else {
			fmt.Println(-1)
		}
	}

}

type IntHeap []int

func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }

func (h *IntHeap) Push(x interface{}) {
	// Push and Pop use pointer receivers because they modify the slice's length,
	// not just its contents.
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}


Measured memory_bytes: 40704