#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int(i)=0;(i)<(n);(i)++)
int main(){
    int n,q; cin>>n>>q;
    vector<tuple<ll,ll,ll>> tap;
    rep(i,n){
        ll s,t,x; cin>>s>>t>>x;
        tap.push_back(make_tuple(s-x,0,x));
        tap.push_back(make_tuple(t-x,-1,x));
    }
    rep(i,q){
        ll d; cin>>d;
        tap.push_back(make_tuple(d,1,i));
    }
    sort(tap.begin(),tap.end());
    multiset<ll> se; 
    vector <ll> ans(q);
    rep(i,tap.size()){
        ll c=get<1>(tap[i]), v=get<2>(tap[i]);
        if(c==1){if(se.empty()) {ans[v]=-1;} else ans[v]=*(se.lower_bound(0));}
        else if(!c) se.insert(v);
        else se.erase(v);
    }
    rep(i,q) cout<<ans[i]<<endl;
}
