import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;

immutable long MOD = 10^^9 + 7;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto Q = s[1];
    auto STX = N.iota.map!(_ => readln.split.map!(to!long).array).array;
    auto D = Q.iota.map!(_ => readln.chomp.to!long).array;

    auto rbt = new RedBlackTree!(Tuple!(long, int), "a[0] < b[0]", true);
    foreach (i, d; D) rbt.insert(tuple(d, i.to!int));

    STX.sort!"a[2] < b[2]";
    auto ans = new long[](Q);
    ans[] = -1;

    foreach (stx; STX) {
        auto S = stx[0];
        auto T = stx[1] - 1;
        auto X = stx[2];
        auto l = S - X;
        auto r = T - X;
        auto lb = rbt.upperBound(tuple(l-1, 0));
        Tuple!(long, int)[] to_remove;
        foreach (x; lb) {
            if (x[0] > r) break;
            ans[x[1]] = X;
            to_remove ~= x;
        }
        foreach (x; to_remove) {
            rbt.removeKey(x);
        }
    }

    ans.each!writeln;
}