import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val q = sc.nextInt()
    val a = Array(n * 2) { IntArray(3) }
    for (i in 0 until n) {
        val s = sc.nextInt()
        val t = sc.nextInt()
        val x = sc.nextInt()
        a[i + n][0] = s - x
        a[i + n][1] = 1
        a[i + n][2] = x
        a[i][0] = t - x
        a[i][1] = -1
        a[i][2] = x
    }
    Arrays.sort(a) { x, y -> x[0] - y[0] }
    val d = IntArray(q)
    for (i in 0 until q) {
        d[i] = sc.nextInt()
    }
    val ans = IntArray(q)
    Arrays.fill(ans, -1)
    val set = TreeSet<Int>()
    var idx = 0
    val sb = StringBuilder()
    for (i in 0 until n * 2) {
        while (idx < q && d[idx] < a[i][0]) {
            if (set.isEmpty())
                ans[idx] = -1
            else
                ans[idx] = set.first()
            idx++
        }
        if (idx == q) break
        if (a[i][1] == 1) {
            set.add(a[i][2])
        } else {
            set.remove(a[i][2])
        }
    }
    for (i in 0 until q) {
        sb.append(ans[i]).append("\n")
    }
    println(sb.toString())
    sc.close()

}


