#include <bits/stdc++.h>
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define FSP(x) fixed << setprecision(x)
using namespace std;
using ll = long long;
constexpr ll INF = LLONG_MAX;
constexpr long double PI = acosl(-1);
void Yes() {cout << "Yes\n";}
void No() {cout << "No\n";}
void YES() {cout << "YES\n";}
void NO() {cout << "NO\n";}

#include <vector>
#include <climits>
#include <functional>

/*	verified 2020/07/18
		AOJ, RMQ and RUQ
		http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_F
*/

template<typename T>
struct segment_tree {
	long long N;					// the size of V
	long long M;					// the number of leaves
	std::vector<T> V;				// Segment Tree, 1-indexed
	std::vector<T> W;				// vector for laze evaluation, 1-indexed
	std::vector<bool> flag;			// true : unevaluated elements exists under W[i]
	std::function<T(T, T)> OP1;		// binary operation for V
	std::function<T(T, T, T)> OP2;	// operation for lazy evaluation (W -> V)
	std::function<T(T, T)> OP3;		// binary operation for W
	T ID1;							// identity element of OP1
	T ID2;							// identity element of OP2 and OP3

	segment_tree(
		std::vector<T>& a,
		std::function<T(T, T)> f,
		std::function<T(T, T, T)> g,
		std::function<T(T, T)> h,
		T t1, T t2
	) : OP1(f), OP2(g), OP3(h), ID1(t1), ID2(t2) {
		M = 1;
		while (M < a.size()) M *= 2;
		N = 2 * M;
		V.resize(N, ID1); W.resize(N, ID2); flag.resize(N, false);
		for (long long i = 0; i < a.size(); i++) V[M + i] = a[i];
		for (long long i = M - 1; i > 0; i--) {
			V[i] = OP1(V[2 * i], V[2 * i + 1]);
		}
	}
	segment_tree() {}

	void init(
		std::vector<T>& a,
		std::function<T(T, T)> f,
		std::function<T(T, T, T)> g,
		std::function<T(T, T)> h,
		T t1, T t2
	) {
		OP1 = f; OP2 = g; OP3 = h; ID1 = t1; ID2 = t2;
		M = 1;
		while (M < a.size()) M *= 2;
		N = 2 * M;
		V.resize(N, ID1); W.resize(N, ID2); flag.resize(N, false);
		for (long long i = 0; i < a.size(); i++) V[M + i] = a[i];
		for (long long i = M - 1; i > 0; i--) {
			V[i] = OP1(V[2 * i], V[2 * i + 1]);
		}
	}

	void laze_eval(long long cur_node, long long width) {
		if (W[cur_node] != ID2) {
			V[cur_node] = OP2(V[cur_node], W[cur_node], width);
			if (width > 1) {
				W[cur_node * 2] = OP3(W[cur_node * 2], W[cur_node]);
				W[cur_node * 2 + 1] = OP3(W[cur_node * 2 + 1], W[cur_node]);
			}
			W[cur_node] = ID2;
		}
	}

	void range_update(
		long long l, long long r, T x,
		long long cur_node = 1,
		long long cur_left = 0, long long cur_right = -1
	) {
		if (cur_right == -1) cur_right = M;
		long long width = cur_right - cur_left;
		if (cur_right <= l || r <= cur_left) return;
		if (l <= cur_left && cur_right <= r) {
			W[cur_node] = OP3(W[cur_node], x);
		}
		else {
			laze_eval(cur_node, width);
			flag[cur_node] = true;
			long long mid = (cur_left + cur_right) / 2;
			range_update(l, r, x, cur_node * 2, cur_left, mid);
			range_update(l, r, x, cur_node * 2 + 1, mid, cur_right);
			V[cur_node] = OP1(V[cur_node * 2], V[cur_node * 2 + 1]);
		}
	}

	T range_fold(
		long long l, long long r,
		long long cur_node = 1,
		long long cur_left = 0, long long cur_right = -1
	) {
		if (cur_right == -1) cur_right = M;
		long long width = cur_right - cur_left;
		if (cur_right <= l || r <= cur_left) return ID1;
		laze_eval(cur_node, width);
		if (width == 1) {
			flag[cur_node] = false;
			return V[cur_node];
		}
		long long mid = (cur_left + cur_right) / 2;
		if (l <= cur_left && cur_right <= r && !flag[cur_node]) {
			return V[cur_node];
		}
		else if (l <= cur_left && cur_right <= r) {
			flag[cur_node] = false;
			range_fold(cur_left, mid);
			range_fold(mid, cur_right);
			return V[cur_node] = OP1(V[cur_node * 2], V[cur_node * 2 + 1]);
		}
		return OP1(
			range_fold(l, r, cur_node * 2, cur_left, mid),
			range_fold(l, r, cur_node * 2 + 1, mid, cur_right)
		);
	}
};

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	//constexpr ll P = 1e9 + 7;
	//constexpr ll P = 998244353;

	ll n, q;
	cin >> n >> q;
	vector<ll> s(n), t(n), x(n), d(q);
	for (ll i = 0; i < n; i++) cin >> s[i] >> t[i] >> x[i];
	for (ll i = 0; i < q; i++) cin >> d[i];

	vector<ll> v(q, INF);
	auto f = [] (ll a, ll b) {return min(a, b);};
	auto g = [] (ll a, ll b, ll c) {return min(a, b);};
	auto h = [] (ll a, ll b) {return min(a, b);};
	ll id1 = INF, id2 = INF;
	segment_tree<ll> sg(v, f, g, h, id1, id2);

	for (ll i = 0; i < n; i++) {
		ll l = s[i] - x[i], r = t[i] - x[i];
		auto itr1 = lower_bound(ALL(d), l);
		auto itr2 = lower_bound(ALL(d), r);
		l = itr1 - d.begin(), r = itr2 - d.begin();
		if (l == r) continue;
		sg.range_update(l, r, x[i]);
	}

	for (ll i = 0; i < q; i++) {
		ll x = sg.range_fold(i, i + 1);
		cout << ((x < INF)?x:-1) << '\n';
	}
}

Measured memory_bytes: 19280