import java.io.PrintWriter
import java.util.TreeSet
val pw = PrintWriter(System.out)
fun main(args: Array<String>) {
    func()
    pw.flush()
}
fun println(value: Any) { pw.println(value) }

private data class Work(val start: Int, val end: Int, val dist: Int)
private data class Position(val pos: Int, val index: Int)

fun func() {
    val (n, q) = listOfInt()
    var workList = mutableListOf<Work>()

    for (n in 0 until n) {
        val (S, T, X) = listOfInt()
        var start = Math.ceil(S - 0.5 - X).toInt()
        var end = Math.floor(T - 0.5 - X).toInt()
        workList.add(Work(start, end, X))
    }
    workList.sortBy { it.dist }
    var posSet = TreeSet<Position> { a, b -> a.pos - b.pos }
    for (n in 0 until q) {
        posSet.add(Position(nextInt(), n))
    }
    val ans = IntArray(q) { -1 }
    for (work in workList) {
        val comp = Position(work.start,-1)
        var iter = posSet.tailSet(comp).iterator()
        while (iter.hasNext()) {
            val position = iter.next()
            if (position.pos > work.end) break
            iter.remove()
            ans[position.index] = work.dist
        }
    }
    println(ans.joinToString("\n"))
}

fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) } //{ it.toInt() }
