#include<bits/stdc++.h>
using namespace std;
 
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define rep(i,n,m) for(ll i = n; i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = n - 1; i >= (ll)(m); i--)
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
void chmin(T &a,T b){if(a>b)a=b;}
template<typename T>
void chmax(T &a,T b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
void debug(vector<vector<ll>>v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
void debug(vector<ll>v,ll n){cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
vector<vector<ll>>vec(ll x, ll y, ll w){
  vector<vector<ll>>v(x,vector<ll>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while((r=x%y)!=0){x=y;y=r;}return y;}
//m.emplace(x,0).fi->se++;
 
template<typename T>
struct LazySegmentTree{
  using F = function<T(T,T)>;
  vector<T> data, lazy; 
  ll n,lastlen = 1;
  F func = [](T a, T b){return a<b?a:b;};
  T iden = INT_MAX; //identity element
  F f_lazy = [](T a, T b){return a<b?a:b;};
  T iden_l = INT_MAX;
  F f_trans = [](T a, ll range){return a;};
  vector<int> judge;
  LazySegmentTree(vector<T> v){
    n = (ll)v.size();
    while(lastlen < n)lastlen *= 2;
    data.assign(lastlen*2-1,iden);
    lazy.assign(lastlen*2-1,iden_l);
    judge.assign(lastlen*2-1,1);
    for(ll i=0;i<n;i++)data[i+lastlen-1] = v[i];
    for(ll i=lastlen-2;i>=0;i--){
      data[i] = func(data[2*i+1], data[2*i+2]);
    }
  }
  void eval(ll k, ll left, ll right){
    if(lazy[k] != iden_l){
      data[k] = f_lazy(data[k],
      f_trans(lazy[k],right-left));
      if(k <= lastlen - 2){
        lazy[2*k+1] = f_lazy(lazy[2*k+1],lazy[k]);
        lazy[2*k+2] = f_lazy(lazy[2*k+2],lazy[k]);
      }
      lazy[k] = iden_l;
    }
  }
  void update(ll a,ll b,T x){
    stack<pair<ll,P>> st;
    st.emplace(0,make_pair(0,lastlen));
    T ret = iden;
    while(!st.empty()){
      ll point = st.top().first; 
      ll left = st.top().second.first;
      ll right = st.top().second.second;
      eval(point,left,right);
      if(b <= left || right <= a)st.pop();
      else if(a <= left && right <= b ){
        st.pop();
        lazy[point] = x;
        eval(point,left,right);
      }
      else{
        if(judge[point]){
          st.emplace(point*2+1, make_pair(left, (left+right)/2));
          st.emplace(point*2+2, make_pair((left+right)/2, right));
          judge[point] = 0;
        }
        else{
          data[point] = func(data[2*point+1], data[2*point+2]);
          judge[point] = 1;
          st.pop();
        }
      }      
    }
  }
  T query(ll a,ll b){
    stack<pair<ll,P>> st;
    st.emplace(0,make_pair(0,lastlen));
    T ret = iden;
    while(!st.empty()){
      ll point = st.top().first; 
      ll left = st.top().second.first;
      ll right = st.top().second.second;
      eval(point, left, right);
      if(b <= left || right <= a)st.pop();
      else if(a <= left && right <= b ){
        st.pop();
        ret = func(ret, data[point]);
      }
      else{
        if(judge[point]){
          st.emplace(point*2+1, make_pair(left, (left+right)/2));
          st.emplace(point*2+2, make_pair((left+right)/2, right));
          judge[point] = 0;
        }
        else{
          data[point] = func(data[2*point+1], data[2*point+2]);
          judge[point] = 1;
          st.pop();
        }
      }      
    }
    return ret;
  }
  void print(){
    ll num=0;
    for(ll i=lastlen;i>0;i/=2)num++;
    ll tmp=1;
    for(ll i=0;i<num;i++,tmp*=2){
      for(ll j=0;j<tmp;j++){
        if(data[tmp-1+j]==iden)cout<<"x"<<" ";
        else cout<<data[tmp-1+j]<<" ";
      };
      cout<<"|";
    }
    cout<<endl;
    tmp=1;
    for(ll i=0;i<num;i++,tmp*=2){
      for(ll j=0;j<tmp;j++){
        if(lazy[tmp-1+j]==iden_l)cout<<"x"<<" ";
        else cout<<lazy[tmp-1+j]<<" ";
      }
      cout<<"|";
    }
    cout<<endl;
  }
};
 
template<typename T>
map<T,ll> compress(vector<T> v){
  auto t=v;
  sort(ALL(t));
  t.erase(unique(ALL(t)),t.end());
  map<T, ll> ret;
  for(ll i=0;i<(ll)t.size();i++)
    ret[t[i]]=i;
  return ret;
}
 
int main(){
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  ll res=0,res1=INF,res2=-INF,buf=0;
  bool judge = true;
  ll n,q;cin>>n>>q;
  vector<ll>s(n),t(n),x(n),d(q);
  rep(i,0,n)cin>>s[i]>>t[i]>>x[i];
  rep(i,0,q)cin>>d[i];
  auto index=compress(d);
  index.emplace(INT_MAX,q);
  LazySegmentTree<ll>segtree(vector<ll>(q+1,INT_MAX));
  rep(i,0,n){
    auto itr=index.lower_bound(s[i]-x[i]);
    auto itr2=index.upper_bound(t[i]-x[i]-1);
    if(itr!=itr2){
      segtree.update(itr->second,itr2->second,x[i]);
    }
    //cout<<itr->first spa itr2->first<<endl;
    //segtree.print();
  }
  //cout<<endl;
  //segtree.print();
  rep(i,0,q){
    ll x=segtree.query(i,i+1);
    if(x==INT_MAX)cout<<-1<<endl;
    else cout<<x<<endl;
  }
  return 0;
}

Measured memory_bytes: 32456