#include<bits/stdc++.h>
using namespace std;
int main(){
  int N, Q;
  cin >> N >> Q;
  vector<vector<int>> vec(N,vector<int>(3));
  for(int i=0; i<N; i++){
    for(int j=0; j<3; j++){
      cin >> vec.at(i).at(j);
    }
  }
  vector<int> query(Q+2,-1e9);
  for(int i=1; i<=Q; i++){
    cin >> query.at(i);
  }
  query.at(Q+1) = 1e9+10;
  vector<vector<int>> in(Q+2,vector<int>(0));
  vector<vector<int>> out(Q+2,vector<int>(0)); 
  
  vector<int>::iterator pos;
  int idx;
  for(int i=0; i<N; i++){
    int s = vec.at(i).at(0);
    int e = vec.at(i).at(1);
    int p = vec.at(i).at(2);
    pos = lower_bound(query.begin(),query.end(),s-p);
    idx = distance(query.begin(),pos);
    in.at(idx).push_back(p);
    pos = lower_bound(query.begin(),query.end(),e-p);
    idx = distance(query.begin(),pos);
    out.at(idx).push_back(p);
  }
  
  map<int,int> mp;
  mp[1e9+10] = 1;
  for(int i=0; i<Q+1; i++){
    for(int j=0; j<in.at(i).size(); j++){
      if(mp.count(in.at(i).at(j))){
        mp[in.at(i).at(j)]++;
      }
      else{
        mp[in.at(i).at(j)] = 1;
      }
    }
    for(int j=0; j<out.at(i).size(); j++){
      mp[out.at(i).at(j)]--;
      if(mp[out.at(i).at(j)] == 0){
        mp.erase(out.at(i).at(j));
      }
    }
    if(i != 0){
      int x = mp.begin()->first;
      if(x == 1e9+10){
        cout << -1 << endl;
      }
      else{
        cout << x << endl;
      }
    }
  }
}
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
    int N, Q;
    cin>>N>>Q;
    vector<pair<ll, ll> > sarr(N), tarr(N);
    multiset<ll> xset;
    ll S, T, X;
    for(int i=0;i<N;++i){
        cin>>S>>T>>X;
        sarr[i] = mp(S-X, X);
        tarr[i] = mp(T-X, X);
    }
    sort(sarr.begin(), sarr.end());
    sort(tarr.begin(), tarr.end());
    ll D[Q];
    for(int i=0;i<Q;++i){
        cin>>D[i];
    }
    ll ans[Q];
    int sindex = 0, tindex = 0;
    for(int i=0;i<Q;++i){
        while(sindex<N && sarr[sindex].fi<=D[i]){
            xset.insert(sarr[sindex].se);
            sindex++;
        }
        while(tindex<N && tarr[tindex].fi<=D[i]){
            xset.erase(xset.find(tarr[tindex].se));
            tindex++;
        }
        if(sindex==tindex) ans[i] = -1;
        else ans[i] = *xset.begin();
    }
    for(int i=0;i<Q;++i){
        cout<<ans[i]<<endl;
    }
}

