import std.algorithm;
import std.container;
import std.conv;
import std.functional;
import std.math;
import std.meta;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.traits;
import std.typecons;

alias Event = Tuple!(long, "t", long, "id", string, "type", long, "value");
alias Cand = Tuple!(long, "value", long, "id");

auto solve(long N, long Q, long[] S, long[] T, long[] X, long[] D) {
    auto events = make!(RedBlackTree!Event);
    foreach (s, t, x, n; zip(S, T, X, iota(N))) {
        events.insert(Event(s - x, n, "add", x));
        events.insert(Event(t - x, n, "dispose", x));
    }

    auto cands = make!(RedBlackTree!Cand);
    auto disposed = make!(RedBlackTree!long);
    foreach (d; D) {
        while (!events.empty && events.front.t <= d) {
            auto e = events.front;
            events.removeFront;

            if (e.type == "add")
                cands.insert(Cand(e.value, e.id));
            else
                disposed.insert(e.id);
        }

        while (!cands.empty && cands.front.id in disposed)
            cands.removeFront;

        if (cands.empty)
            writeln(-1);
        else
            writeln(cands.front.value);
    }
}

void main() {
    auto input = stdin.byLine.map!split.joiner;

    long N;
    N = input.front.to!long;
    input.popFront;

    long Q;
    Q = input.front.to!long;
    input.popFront;

    long[] S = new long[](cast(size_t) (N));
    long[] T = new long[](cast(size_t) (N));
    long[] X = new long[](cast(size_t) (N));
    foreach (i; 0 .. cast(size_t) (N)) {
        S[i] = input.front.to!long;
        input.popFront;
        T[i] = input.front.to!long;
        input.popFront;
        X[i] = input.front.to!long;
        input.popFront;
    }

    long[] D = new long[](cast(size_t) (Q));
    foreach (i; 0 .. cast(size_t) (Q)) {
        D[i] = input.front.to!long;
        input.popFront;
    }

    static if (is(ReturnType!solve == void))
        solve(N, Q, S, T, X, D);
    else
        solve(N, Q, S, T, X, D).writeln;
}
