import java.io.IOException
import java.io.InputStream
import java.io.PrintWriter
import java.util.*


fun main(args: Array<String>) {
    val sc = FastScanner()
    val N = sc.nextInt()
    val Q = sc.nextInt()
    val S = Array(N) {0L}
    val T = Array(N) {0L}
    val X = Array(N) {0L}
    for (i in S.indices) {
        S[i] = sc.nextLong()
        T[i] = sc.nextLong()
        X[i] = sc.nextLong()
    }
    val D = Array(Q) { sc.nextLong() }

    val events = ArrayList<Triple<Int, Long, Long>>()
    for (i in S.indices) {
        events.add(Triple(1, S[i] - X[i], X[i]))
        events.add(Triple(0, T[i] - X[i], X[i]))
    }
    for (d in D) {
        events.add(Triple(2, d, 0L))
    }

    events.sortWith(Comparator { a, b -> when {
        a.second != b.second -> (a.second - b.second).toInt()
        else -> a.first - b.first
    } })

    val st = TreeSet<Long>()

    val out = PrintWriter(System.out)
    for (e in events) {
        when (e.first) {
            0 -> st.remove(e.third)
            1 -> st.add(e.third)
            2 -> out.println(st.firstOrNull() ?: -1)
        }
    }
    out.flush()
}

internal class FastScanner {
    private val `in`: InputStream = System.`in`
    private val buffer = ByteArray(1024)
    private var ptr = 0
    private var buflen = 0
    private fun hasNextByte(): Boolean {
        if (ptr < buflen) {
            return true
        } else {
            ptr = 0
            try {
                buflen = `in`.read(buffer)
            } catch (e: IOException) {
                e.printStackTrace()
            }
            if (buflen <= 0) {
                return false
            }
        }
        return true
    }

    private fun readByte(): Int {
        return if (hasNextByte()) buffer[ptr++].toInt() else -1
    }

    operator fun hasNext(): Boolean {
        while (hasNextByte() && !isPrintableChar(buffer[ptr].toInt())) ptr++
        return hasNextByte()
    }

    operator fun next(): String {
        if (!hasNext()) throw NoSuchElementException()
        val sb = StringBuilder()
        var b = readByte()
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b)
            b = readByte()
        }
        return sb.toString()
    }

    fun nextLong(): Long {
        if (!hasNext()) throw NoSuchElementException()
        var n: Long = 0
        var minus = false
        var b = readByte()
        if (b == '-'.toInt()) {
            minus = true
            b = readByte()
        }
        if (b < '0'.toInt() || '9'.toInt() < b) {
            throw NumberFormatException()
        }
        while (true) {
            if ('0'.toInt() <= b && b <= '9'.toInt()) {
                n *= 10
                n += b - '0'.toInt().toLong()
            } else return if (b == -1 || !isPrintableChar(b)) {
                if (minus) -n else n
            } else {
                throw NumberFormatException()
            }
            b = readByte()
        }
    }

    fun nextInt(): Int {
        val nl = nextLong()
        if (nl < Int.MIN_VALUE || nl > Int.MAX_VALUE) throw NumberFormatException()
        return nl.toInt()
    }

    fun nextDouble(): Double {
        return next().toDouble()
    }

    companion object {
        private fun isPrintableChar(c: Int): Boolean {
            return 33 <= c && c <= 126
        }
    }
}


Measured memory_bytes: 132884