#include <bits/stdc++.h>
#include <queue>
#include <set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<vector<ll> > vv64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 1000000007;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(ll i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF LLONG_MAX

ll in(ll d[], ll a, ll q){
	ll l=0,r=q;
	while(r!=l){
		ll mid=(l+r)/2;
		if(d[mid]<a){
			l = mid+1;
		}
		else{
			r = mid;
		}
	}
	return l;
}

ll in(vector<ll> & d, ll a, ll q){
	ll l=0,r=q;
	while(r!=l){
		ll mid=(l+r)/2;
		if(d[mid]<a){
			l = mid+1;
		}
		else{
			r = mid;
		}
	}
	return l;
}

void solve(){
    ll n,q;
    cin >> n >> q;
    set<pair<ll,p64> > s;
    ll d[q];
    vv64 nx(q);
    forn(i,n){
    	ll a,b,c;
    	cin >> a >> b >> c;
    	s.insert(mp(c,mp(a,b)));
    }
    forn(i,q) cin >> d[i];
    ll ans[q];
    forn(i,q) ans[i]=-1;
    ll di[n];
    ll index = 0;
    for(auto it : s){
    	ll in1 = in(d,it.se.fi-it.fi,q);
    	ll in2 = in(d,it.se.se-it.fi,q);
    	di[index]=it.fi;
    	if(in1!=q) nx[in1].pb(index+1);
    	if(in2!=q) nx[in2].pb(-1*index-1);
    	index++;
    }
    ll prev=-1;
    // forn(i,q) sort(nx[i].begin(),nx[i].end(), greater <>());
    set<ll> st,e;
    // forn(i,n) cout << di[i] << " ";
    // cout << ln;
    // forn(i,q){
    // 	cout << i << "      ";
    // 	forn(j,(ll)nx[i].size()) cout << nx[i][j] << " ";
    // 	cout << ln; 
    // }
    forn(i,q){
    	forn(j,(ll)nx[i].size()){
    		if(nx[i][j]<0){
    			e.insert(-1*nx[i][j]-1);
    			// ll in1 = in(e,-1*nx[i][j]-1,(ll)e.size());
    			// e[(ll)e.size()-1]=e[in1];
    			// e[in1]=-1*nx[i][j]-1;
    		}
    		else{
    			st.insert(nx[i][j]-1);
    			// ll in1 = in(st,nx[i][j]-1,(ll)st.size());
    			// st[(ll)st.size()-1]=st[in1];
    			// st[in1]=nx[i][j]-1;
    		}
    	}
    	// sort(st.begin(),st.end(), greater <>());
    	// sort(e.begin(),e.end(), greater <>());
    	while((ll)st.size()>0 && (ll)e.size()>0){
    		set<ll>::iterator it1 = st.begin();
    		set<ll>::iterator it2 = e.begin();
    		if(*it1==*it2){
    			st.erase(it1);
    			e.erase(it2);
    		}
    		else{
    			break;
    		}
    		// e.pop_back();
    		// st.pop_back();
    	}
    	if((ll)st.size()>0){
    		set<ll>::iterator it1 = st.begin();
    		cout << di[*it1] << ln;
    	}
    	else{
    		cout << -1 << ln;
    	}

    }
    // forn(i,q){
    // 	cout << ans[i] << ln;
    // }
}


int main()
{
	ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll t=1;
    // cin >> t;
    forn(i,t) solve();
    return 0;
}

Measured memory_bytes: 49640