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

const int N = 2e5 + 100;

int n, q, l[N], r[N], x[N], d[N], ans[N];
vector<int> add[N], del[N];// avval add bad del
multiset<int> st;

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> n >> q;
	for (int i = 0; i < n; i++) {
		cin >> l[i] >> r[i] >> x[i];
		l[i] = max(0, l[i] - x[i]);
		r[i] = max(0, r[i] - x[i]);
	}
	for (int i = 0; i < q; i++)
		cin >> d[i];
	for (int i = 0; i < n; i++) {
		add[lower_bound(d, d + q, l[i]) - d].push_back(x[i]);
		del[lower_bound(d, d + q, r[i]) - d].push_back(x[i]);
	}
	for (int i = 0; i < q; i++) {
		for (int num: add[i])
			st.insert(num);
		for (int num: del[i])
			st.erase(st.find(num));
		ans[i] = (st.empty()? -1: *st.begin());
	}
	for (int i = 0; i < q; i++)
		cout << ans[i] << '\n';
	return 0;
}