#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = int(A); I < int(B); ++I)
#define FORR(I,A,B) for(ll I = int((B)-1); I >= int(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=1e18+7;
const ll MOD=1e9+7;

// http://drken1215.hatenablog.com/entry/2019/02/19/110200
// Segment Tree
template<class Monoid, class Action> struct SegTree {
	using FuncMonoid = function< Monoid(Monoid, Monoid) >;
	using FuncAction = function< void(Monoid&, Action) >;
	using FuncLazy = function< void(Action&, Action) >;
	FuncMonoid FM;
	FuncAction FA;
	FuncLazy FL;
	Monoid UNITY_MONOID;
	Action UNITY_LAZY;
	int SIZE, HEIGHT;
	vector<Monoid> dat;
	vector<Action> lazy;
	
	SegTree() { }
	SegTree(int n, const FuncMonoid fm, const FuncAction fa, const FuncLazy fl,
			const Monoid &unity_monoid, const Action &unity_lazy)
	: FM(fm), FA(fa), FL(fl), UNITY_MONOID(unity_monoid), UNITY_LAZY(unity_lazy) {
		SIZE = 1; HEIGHT = 0;
		while (SIZE < n) SIZE <<= 1, ++HEIGHT;
		dat.assign(SIZE * 2, UNITY_MONOID);
		lazy.assign(SIZE * 2, UNITY_LAZY);
	}
	void init(int n, const FuncMonoid fm, const FuncAction fa, const FuncLazy fl,
			  const Monoid &unity_monoid, const Action &unity_lazy) {
		FM = fm; FA = fa; FL = fl;
		UNITY_MONOID = unity_monoid; UNITY_LAZY = unity_lazy;
		SIZE = 1; HEIGHT = 0;
		while (SIZE < n) SIZE <<= 1, ++HEIGHT;
		dat.assign(SIZE * 2, UNITY_MONOID);
		lazy.assign(SIZE * 2, UNITY_LAZY);
	}
	
	/* set, a is 0-indexed */
	void set(int a, const Monoid &v) { dat[a + SIZE] = v; }
	void build() {
		for (int k = SIZE - 1; k > 0; --k)
			dat[k] = FM(dat[k*2], dat[k*2+1]);
	}
	
	/* update [a, b) */
	inline void evaluate(int k) {
		if (lazy[k] == UNITY_LAZY) return;
		if (k < SIZE) FL(lazy[k*2], lazy[k]), FL(lazy[k*2+1], lazy[k]);
		FA(dat[k], lazy[k]);
		lazy[k] = UNITY_LAZY;
	}
	inline void update(int a, int b, const Action &v, int k, int l, int r) {
		evaluate(k);
		if (a <= l && r <= b)  FL(lazy[k], v), evaluate(k);
		else if (a < r && l < b) {
			update(a, b, v, k*2, l, (l+r)>>1), update(a, b, v, k*2+1, (l+r)>>1, r);
			dat[k] = FM(dat[k*2], dat[k*2+1]);
		}
	}
	inline void update(int a, int b, const Action &v) { update(a, b, v, 1, 0, SIZE); }
	
	/* get [a, b) */
	inline Monoid get(int a, int b, int k, int l, int r) {
		evaluate(k);
		if (a <= l && r <= b)
			return dat[k];
		else if (a < r && l < b)
			return FM(get(a, b, k*2, l, (l+r)>>1), get(a, b, k*2+1, (l+r)>>1, r));
		else
			return UNITY_MONOID;
	}
	inline Monoid get(int a, int b) { return get(a, b, 1, 0, SIZE); }
	inline Monoid operator [] (int a) { return get(a, a+1); }
	
	/* debug */
	void print() {
		for (int i = 0; i < SIZE; ++i) { cout << (*this)[i]; if (i != SIZE) cout << ","; }
		cout << endl;
	}
};

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

	ll N,Q;
	cin >> N >> Q;
	auto fm = [](ll a, ll b) { return min(a, b); };
	auto fa = [](ll &a, ll d) { a = min(a, d); };
	auto fl = [](ll &d, ll e) { d = min(d, e); };
	SegTree<ll,ll> tr(Q+8,fm,fa,fl,INF,INF);
	vector< pair<ll, pair<ll,ll> > > xst(N);
	FOR(i,0,N){
		ll s,t,x;
		cin >> s >> t >> x;
		xst[i] = {x,{s,t}};
	}
	vector<ll> D(Q);
	FOR(i,0,Q){
		cin >> D[i];
	}
	D.push_back(INF);
	SORT(xst);
	REV(xst);
	FOR(i,0,N){
		ll s_x = xst[i].second.first - xst[i].first;
		ll t_x = xst[i].second.second - xst[i].first;
		ll a = POSL(D,s_x);
		ll b = POSU(D,t_x-1);//含まない
		tr.update(a,b,xst[i].first);
	}
	FOR(i,0,Q){
		ll ans = tr.get(i,i+1);
		if(ans==INF||ans<0) ans = -1;
		cout << ans << endl;
	}
}


Measured memory_bytes: 18772