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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	ll N,Q;
	cin >> N >> Q;
	vector<pair<ll,ll>> x(N);
	vector<ll> s(N),t(N);
	for(int i=0;i<N;++i){
		cin >> s[i] >> t[i] >> x[i].first;
		x[i].second = i;
		s[i] -= x[i].first;
		t[i] -= x[i].first;
	}
	sort(x.begin(),x.end());
	set<ll> d;
	map<ll,ll> ma;
	for(int i=0;i<Q;++i){
		ll di;
		cin >> di;
		ma[di] = i;
		d.insert(di);
	}
	vector<ll> ans(Q,-1);
	for(int i=0;i<N;++i){
		ll xi = x[i].first;
		ll si = s[x[i].second];
		ll ti = t[x[i].second];
		vector<ll> del;
		auto l = d.lower_bound(si);
		auto r = d.lower_bound(ti);
		while(l!=r){
			ans[ma[*l]] = xi;
			del.push_back(*l);
			l++;
		}
		for(auto er:del) d.erase(er);
	}
	for(auto a:ans){
		cout << a << endl;
	}
}
