#include<iostream>
#include<vector>
#include<functional>
#include<algorithm>
#include<iomanip>

using namespace std;

typedef long long ll;

template <class Monoid1, class Monoid2> struct LazySegTree {
	int N;
	vector<Monoid1> node;
	vector<Monoid2> lazy;
	std::function<Monoid1(Monoid1, Monoid1)> operation1;
	std::function<Monoid2(Monoid2, Monoid2)> operation2;
	std::function<Monoid1(Monoid1, Monoid2)> operation3;
	std::function<Monoid2(Monoid2, int)> operation4;
	Monoid1 unit1;//Monoid1の単位元
	Monoid2 unit2;//Monoid2の単位元

	LazySegTree(vector<Monoid1>& data,
		std::function<Monoid1(Monoid1, Monoid1)> op1,
		std::function<Monoid2(Monoid2, Monoid2)> op2,
		std::function<Monoid1(Monoid1, Monoid2)> op3,
		std::function<Monoid2(Monoid2, int)> op4,
		Monoid1 U1, Monoid2 U2) {
		//データ　演算1~4　単位元1~2
		operation1 = op1;
		operation2 = op2;
		operation3 = op3;
		operation4 = op4;
		unit1 = U1;
		unit2 = U2;
		int size = data.size();
		N = 1;
		while (N < size)N <<= 1;
		node.resize(2 * N - 1, unit1);
		lazy.resize(2 * N - 1, unit2);

		for (int i = 0; i < size; i++) {
			node[i + N - 1] = data[i];
		}

		for (int i = N - 2; i >= 0; i--) {
			node[i] = operation1(node[i * 2 + 1], node[i * 2 + 2]);
		}
	}

	//番号kのデータを伝播させる。
	void eval(int k, int l, int r) {
		if (lazy[k] == unit2)return;
		node[k] = operation3(node[k], operation4(lazy[k], r - l));
		if (r - l > 1) {
			//子を持ってる
			lazy[2 * k + 1] = operation2(lazy[2 * k + 1], lazy[k]);
			lazy[2 * k + 2] = operation2(lazy[2 * k + 2], lazy[k]);
		}
		lazy[k] = unit2;
	}

	void update(Monoid2 val, int idx, int a, int b, int l = 0, int r = -1) {
		//[a, b)
		if (r < 0)r = N;
		eval(idx, l, r);
		//範囲外なら何もしない
		if (b <= l || r <= a)return;
		if (a <= l && r <= b) {
			//完全に被覆してるのなら、遅延配列を更新して評価。
			lazy[idx] = operation3(lazy[idx], val);
			eval(idx, l, r);
			return;
		}
		update(val, idx * 2 + 1, a, b, l, (l + r) / 2);
		update(val, idx * 2 + 2, a, b, (l + r) / 2, r);
		node[idx] = operation1(node[idx * 2 + 1], node[idx * 2 + 2]);
	}

	void update(Monoid2 val, int a, int b) {
		//[a, b)
		update(val, 0, a, b, 0, -1);
	}

	Monoid1 getval(int a, int b, int idx, int l, int r = -1) {
		eval(idx, l, r);
		//[a, b)を求める。　使い方はgetval(a, b, );
		if (r == -1)r = N;
		if (b <= l || r <= a)return unit1;
		if (a <= l && r <= b)return node[idx];
		Monoid1 left = getval(a, b, idx * 2 + 1, l, (l + r) / 2);
		Monoid1 right = getval(a, b, idx * 2 + 2, (l + r) / 2, r);
		return operation1(left, right);
	}

	Monoid1 getval(int a, int b) {
		//ラッパー。
		return getval(a, b, 0, 0, -1);
	}
};

int N, Q;
vector<int> S, T, X, D;
vector<int> pressref;

int unit = 1145141919;

void press(vector<int>& base1, vector<int>& base2, vector<int>& base3, vector<int>& pressref) {
	for (int i = 0; i < base1.size(); i++) {
		pressref.push_back(base1[i]);
	}
	for (int i = 0; i < base2.size(); i++) {
		pressref.push_back(base2[i]);
	}
	for (int i = 0; i < base3.size(); i++) {
		pressref.push_back(base3[i]);
	}
	sort(pressref.begin(), pressref.end());
	pressref.erase(unique(pressref.begin(), pressref.end()), pressref.end());

	for (int i = 0; i < base1.size(); i++) {
		base1[i] = lower_bound(pressref.begin(), pressref.end(), base1[i]) - pressref.begin();
	}
	for (int i = 0; i < base2.size(); i++) {
		base2[i] = lower_bound(pressref.begin(), pressref.end(), base2[i]) - pressref.begin();
	}
	for (int i = 0; i < base3.size(); i++) {
		base3[i] = lower_bound(pressref.begin(), pressref.end(), base3[i]) - pressref.begin();
	}
}

int main() {
	cin >> N >> Q;
	S.resize(N), T.resize(N), D.resize(Q), X.resize(N);
	for (int i = 0; i < N; i++) {
		int s, t, x;
		//[s, t)
		cin >> s >> t >> x;
		S[i] = s - x, T[i] = t - x;
		X[i] = x;
	}
	for (int i = 0; i < Q; i++) {
		cin >> D[i];
	}
	
	press(S, T, D, pressref);

	vector<int> tmp2(pressref.size(), unit);
	LazySegTree<int, int> lst(tmp2, 
		[](int a, int b) {return min(a, b); },
		[](int a, int b) {return min(a, b); }, 
		[](int a, int b) {return min(a, b); }, 
		[](int a, int b) {return a; },
		unit, unit);

	for (int i = 0; i < N; i++) {
		lst.update(X[i], S[i], T[i]);
	}
	for (int i = 0; i < Q; i++) {
		int val = lst.getval(D[i], D[i] + 1);
		if (val == unit)cout << -1 << endl;
		else {
			cout << val << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 26860