#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E17;

#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
///////////////////////////////////////


//ll inf=(1LL<<31)-1;
// 区間更新、区間最大の遅延セグメントツリー
struct RBQRUQ {
    ll n;
    vector<ll> dat, lazy;
    RBQRUQ(){}
    RBQRUQ(ll n_) {
        n = 1; while(n < n_) n *= 2;
        dat.assign(n*2, -inf);
        lazy.assign(n*2, -inf);
    }
    void eval(ll len,ll k) {
        if(lazy[k] ==-inf) return;
        if(k*2+1 < n*2-1) {
            lazy[2*k+1] = lazy[k];
            lazy[2*k+2] = lazy[k];
        }
        dat[k] = lazy[k];
        lazy[k] =-inf;
    }
    // [a, b)をxに変更
    ll update(ll a, ll b, ll x, ll k, ll l, ll r) {
        eval(r-l, k);
        if(b <= l || r <= a) return dat[k];
        if(a <= l && r <= b) {
            lazy[k] = x;
            return lazy[k];
        }
        return dat[k] = max(update(a, b, x, 2*k+1, l, (l+r)/2), update(a, b, x, 2*k+2, (l+r)/2, r));
    }
    ll update(ll a, ll b, ll x) { return update(a, b, x, 0, 0, n); }
    // [a, b)の最大値をreturn
    ll query(ll a, ll b, ll k, ll l, ll r) {
        eval(r-l, k);
        if(b <= l || r <= a) return -inf;
        if(a <= l && r <= b) return dat[k];
        ll vl = query(a, b, 2*k+1, l, (l+r)/2);
        ll vr = query(a, b, 2*k+2, (l+r)/2, r);
        return max(vl, vr);
    }
    ll query(ll a, ll b) { return query(a, b, 0, 0, n); }
};
//セグ木なので番号は0~n-1
/////////////////////////////////////////////////////////////

struct tim{
    ll s,t,x;
    bool operator<(const tim b)const{
        return x<b.x;
    }
};
int main(){fastio
    
    ll n,q;cin>>n>>q;
    tim z[n];
    vector<ll>comp;
    rep(i,0,n-1)cin>>z[i].s>>z[i].t>>z[i].x;
    rep(i,0,n-1){
        if(z[i].s<z[i].x){
            z[i].s=z[i].x;
        }
        if(z[i].t<z[i].x){
            z[i].t=z[i].x;
        }
        comp.pb(z[i].s-z[i].x);
        comp.pb(z[i].t-z[i].x);
    }
    comp.pb(0);comp.pb(inf);
    sort(comp.begin(),comp.end());
    comp.erase(unique(comp.begin(),comp.end()),comp.end());
    
    
    ll vs=comp.size();
    
   // cout<<"comp:";rep(i,0,vs-1)cout<<comp[i]<<" ";cout<<endl;
    
    rep(i,0,n-1){
        z[i].s=lower_bound(comp.begin(),comp.end(),z[i].s-z[i].x)-comp.begin();
        z[i].t=lower_bound(comp.begin(),comp.end(),z[i].t-z[i].x)-comp.begin();
    }
    RBQRUQ u(vs);
    u.update(0,vs,-1);
    
    sort(z,z+n);
    
    
   /* rep(i,0,n-1){
        cout<<z[i].s<<" "<<z[i].t<<" "<<z[i].x<<endl;
    }
    */
    
    for(ll i=n-1;i>=0;i--){
        u.update(z[i].s,z[i].t,z[i].x);
    }
    
    /*rep(i,0,vs-1){
        cout<<u.query(i,i+1)<<" ";
    }cout<<endl;*/
    while(q--){
        ll d;cin>>d;
        ll p=upper_bound(comp.begin(),comp.end(),d)-comp.begin();
        p--;
        cout<<u.query(p,p+1)<<endl;
    }
    
    return 0;
}
/*

 1 1
 5 15 3
 8
 
 */


Measured memory_bytes: 26732