#include <bits/stdc++.h>
using namespace std;

#include <bits/stdc++.h>
using namespace std;

template<class Monoid, class OperatorMonoid = Monoid>
struct LazySegmentTree {
	using FunctionM = function< Monoid(Monoid, Monoid) >;
	using FunctionMO = function< Monoid(Monoid, OperatorMonoid, int) >; // 3rd param = length;
	using FunctionO = function < OperatorMonoid(OperatorMonoid, OperatorMonoid) >;

	int N; vector<Monoid> segment; vector<OperatorMonoid> lazy;
	const FunctionM FuncM; const FunctionMO FuncMO; const FunctionO FuncO;
	const Monoid idM; const OperatorMonoid idOM;

	LazySegmentTree(int n, const FunctionM FuncM, const FunctionMO FuncMO, const FunctionO FuncO,
		const Monoid idM, const OperatorMonoid idOM)
	: FuncM(FuncM), FuncMO(FuncMO), FuncO(FuncO), idM(idM), idOM(idOM) {
		N = 1;
		while (N < n) N <<= 1;
		segment.assign(2 * N, idM); lazy.assign(2 * N, idOM);
	}

	void set(int num, Monoid x) {
		segment[N + num] = x;
	}
	void build() {
		for (int k = N - 1; k > 0; k--) {
			segment[k] = FuncM(segment[2*k], segment[2*k+1]);
		}
	}

	void propagate(int k, int len){
		if (lazy[k] != idOM) {
			if (k < N) {
				lazy[2*k] = FuncO(lazy[2*k], lazy[k]);
				lazy[2*k+1] = FuncO(lazy[2*k+1], lazy[k]);
			}
			segment[k] = FuncMO(segment[k], lazy[k], len);
			lazy[k] = idOM;
		}
	}

	Monoid update(int a, int b, const OperatorMonoid x) {
		return update(a, b, x, 1, 0, N);
	}
	Monoid update(int a, int b, const OperatorMonoid x, int k, int l, int r){
		propagate(k, r-l);
		if (b <= l || r <= a) {
			return segment[k];
		} else if (a <= l && r <= b) {
			lazy[k] = FuncO(lazy[k], x);
			propagate(k, r-l);
			return segment[k];
		} else {
			int m = (l + r) / 2;
			return segment[k] = FuncM(update(a, b, x, 2*k, l, m), update(a, b, x, 2*k+1, m, r));
		}
	}

	Monoid query(int a, int b) {
		return query(a, b, 1, 0, N);
	}
	Monoid query(int a, int b, int k, int l, int r) {
		propagate(k, r-l);
		if (b <= l || r <= a) {
			return idM;
		} else if (a <= l && r <= b) {
			return segment[k];
		} else {
			int m = (l + r) / 2;
			return FuncM(query(a, b, 2*k, l, m), query(a, b, 2*k+1, m, r));
		}
	}

	// 0-indexed numbering;
	Monoid operator[](const int &k) {
		return query(k, k + 1);
	}
};

int F(int a, int b) {return min(a, b);};
int G(int a, int b, int len) {return b;};
int H(int a, int b) {return b;};

int main(){
    int n, q; cin >> n >> q;
    vector<pair<int, pair<int, int>>> x(n);
    set<int> ss;
    ss.insert(0);
    for (int i = 0; i < n; i++) {
        int a, b, c; cin >> a >> b >> c;
        x[i] = {c, {a-c, b-c}};
        ss.insert(a-c); ss.insert(b-c);
    }
    sort(x.rbegin(), x.rend());
    map<int, int> compress;
    vector<int> inv ;
    for (auto w: ss) {
        compress[w] = inv.size();
        inv.emplace_back(w);
    }
    LazySegmentTree<int> lst(inv.size(), F, G, H, INT_MAX, -1);
    for (int i = 0; i < n; i++) {
        auto it = x[i].second;
        lst.update(compress[it.first], compress[it.second], x[i].first);
    }
    for (int i = 0; i < q; i++) {
        int d; cin >> d;
        int left = 0; int right = inv.size();
        while (right - left > 1) {
            int mid = (left + right) / 2;
            if (inv[mid] <= d) left = mid;
            else right = mid;
        }
        if (lst[left] == INT_MAX) cout << -1 << endl;
        else cout << lst[left] << endl;
    }

    return 0;
}

Measured memory_bytes: 52720