import java.lang.Long.parseLong
import java.util.*

fun main(args:Array<String>) {
    val reader = System.`in`.bufferedReader()
    val (N, Q) = reader.readLine()!!.split(" ").map(Integer::parseInt)

    val list = mutableListOf<Triple<Long, Long, Boolean>>()
    for (i in 0 until N) {
        val (S, T, X) = reader.readLine()!!.split(" ").map(java.lang.Long::parseLong)
        list.add(Triple(S-X, X, true))
        list.add(Triple(T-X, X, false))
    }
    list.sortBy { it.first }

    val D = LongArray(Q){parseLong(reader.readLine()!!)}
    D.sort()
    val ans = mutableListOf<Long>()

    var l = 0
    val set = TreeSet<Long>()
    for (d in D) {
        while (l != list.size) {
            var q = list[l]
            if (q.first > d)
                break
            when(q.third){
                true->set.add(q.second)
                false->set.remove(q.second)
            }
            l++
        }
        ans.add(if (set.isEmpty()) -1 else set.first())
    }
    println(ans.joinToString("\n"))
}