typedef int ll;
#include <bits/stdc++.h>
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

unordered_map<ll,ll> zip;

void compress(vector<ll> &x) {
  sort(x.begin(), x.end());
  x.erase(unique(x.begin(),x.end()),x.end());
  for(int i = 0; i < x.size(); i++){
//  zip[x[i]] = x[i];
//    cout<<x[i]<<" -> "<<i<<endl;
 // 
   zip[x[i]] = i;
  }
}
const ll seg_n = 1048576;
ll seg_array[2*seg_n];

void seg_init(){
    for (int i = 0; i < 2*seg_n; i++) {
        seg_array[i] = 1000000000;
    }
}

pair<ll,ll> seg_range(ll node){
    // ノードの長さ
    ll ren = node+1;
    ll count =0;
    while(ren !=0){
        ren = ren/2;
        count++;
    }
    count--;
    ll len = seg_n/ (1 <<count );
//  cout	<<node <<" nl "<<len<<endl;
    // 開始地点は左の子を追えばいい
    ll child = node;
    while(true){
        if( 2*child+1 < 2*seg_n-1 ){
            child = 2*child+1;
        }else{
            break;
        }
    }
//  cout<<child<<endl;
    return {child - seg_n+1, child - seg_n+1 +len-1};
}

void seg_update_range(ll s,ll t,ll v){
  	if(s>t) return;
  	if(t<0) return;
//	cout<<s <<" "<<t<<" "<<v<<endl;

    ll now_node = seg_n-1 + s;
    ll parent = (now_node-1)/2;
    
    if(s==t){
        seg_array[now_node] = min(seg_array[now_node],v);
//      	cout<<now_node<<" "<<seg_range(now_node).first<<" -> "<< seg_range(now_node).second<<" = "<<v<<endl;
        return;
    }
    ll limit = 0;
    while(limit<30){
	      limit++;
        // 親も収まるなら
        pair<ll,ll> now_p = seg_range(parent);
        if(now_p.second <= t && now_p.first == s){
            now_node = parent;
            parent = (now_node-1)/2;
        }else{
            seg_array[now_node] = min(seg_array[now_node],v);
//          	cout<<now_node<<" "<<seg_range(now_node).first<<" -> "<< seg_range(now_node).second<<" = "<<v<<endl;
            break;
        }
    }
    ll end = seg_range(now_node).second;
    if( end < t){
//    	cout<<seg_range(now_node).first<<" "<<seg_range(now_node).second<<endl;
        seg_update_range(end+1,t,v);
    }
}

ll seg_get(ll i){
    // 固有ロジック
    ll min_value = 1000000000;
  
    ll now_node = seg_n-1 + i;
    while(true){
        min_value = min(min_value,seg_array[now_node]);
        if(now_node == 0){
            break;
        }
        now_node = (now_node-1)/2;
    }
    return min_value;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
  
    ll n,q;
    ll s[200010],t[200010],x[200010],d[200010];
	seg_init();
    vector<ll> XX;
    std::cin >> n>>q;
    for (int i = 0; i < n; i++) {
        std::cin >> s[i]>>t[i]>>x[i];
      	if( t[i]-x[i]-1 >= 0 ){
          XX.push_back(max((ll)0,s[i]-x[i]));
          XX.push_back(t[i]-x[i]-1);
        }
    }
    for (int i = 0; i < q; i++) {
        std::cin >> d[i];
        XX.push_back(d[i]);
    }
    compress(XX);
    
    for (int i = 0; i < n; i++) {
      if( t[i]-x[i]-1 >= 0 ){
        seg_update_range(zip[max((ll)0,s[i]-x[i])],zip[t[i]-x[i]-1],x[i]);
      }
    }
    
    for (int i = 0; i < q; i++) {
        ll ans = seg_get(zip[d[i]]);
        if(ans == 1000000000){
            ans = -1;
        }
        std::cout << ans << "\n";
    }
    
}


Measured memory_bytes: 43244