#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll ,ll>;
using T = tuple<ll, ll, ll>;
const ll INF = 1LL<<61LL;
const ll MOD = 1e9+7;

int main(){
	ll N, Q;
	cin >> N >> Q;
	vector<T> stop(N);
	for(int i=0;i<N;i++){
		ll s, t, x;
		cin >> s >> t >> x;
		t--;
		stop[i] = T(x, s, t);
	}
	sort(stop.begin(), stop.end());
	set<P> st;
	for(int i=0;i<Q;i++){
		ll q;
		cin >> q;
		st.insert(P(q, i));
	}
	vector<ll> ans(Q, -1);
	for(auto &&quit : stop){
		ll x, s, t;
		tie(x, s, t) = quit;
		auto ite = st.lower_bound(P(s-x, -10));
		while(ite != st.end() && ite->first <= t-x){
			auto tmp = ite;
			ans[ite->second] = x;
			ite++;
			st.erase(tmp);
		}
	}
	for(int i=0;i<Q;i++)
		cout << ans[i] << endl;
	return 0;
}
