#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n-1);i>=0;i--)
#define FOR(i,n,m) for(int i=n;i<=(int)(m);i++)
#define RFOR(i,n,m) for(int i=(int)(n);i>=m;i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(std::unique(all(x)), x.end());
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
const double PI=acos(-1);
using namespace std;
vector<int> dx={1,0,-1,0};
vector<int> dy={0,1,0,-1};
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

//区間更新・区間最小クエリ
struct LazySegmentTree {
    int n;
    vector<ll> node, lazy;
    vector<bool> lazyFlag;
    
    LazySegmentTree(vector<ll> v) {
        int sz=sz(v);
        n=1;
        while(n<sz) n*=2;
        node.resize(2*n-1);
        lazy.resize(2*n-1, LINF);
        lazyFlag.resize(2*n-1, false);
        
        rep(i,sz) node[i+n-1]=v[i];
        rrep(i,n-1) node[i]=min(node[i*2+1], node[i*2+2]);
    }
    
    void lazyEvaluate(int k, int l, int r) {
        if(lazyFlag[k]) {
            node[k]=lazy[k];
            if(r-l>1) {
                lazy[k*2+1]=lazy[k];
                lazy[k*2+2]=lazy[k];
                lazyFlag[k*2+1]=true;
                lazyFlag[k*2+2]=true;
            }
            lazyFlag[k]=false;
        }
    }
    
    void update(int a, int b, ll x, int k=0, int l=0, int r=-1) {
        if(r<0) r=n;
        lazyEvaluate(k, l, r);
        if(b<=l || r<=a) return;
        
        if(a<=l && r<=b) {
            lazy[k]=x;
            lazyFlag[k]=true;
            lazyEvaluate(k, l, r);
        }
        else {
            update(a, b, x, 2*k+1, l, (l+r)/2);
            update(a, b, x, 2*k+2, (l+r)/2, r);
            node[k]=min(node[2*k+1], node[2*k+2]);
        }
    }
    
    ll getmin(int a, int b, int k=0, int l=0, int r=-1) {
        if(r<0) r=n;
        lazyEvaluate(k, l, r);
        
        if(b<=l || r<=a) return LINF;
        if(a<=l && r<=b) return node[k];
        
        ll vl=getmin(a, b, 2*k+1, l, (l+r)/2);
        ll vr=getmin(a, b, 2*k+2, (l+r)/2, r);
        return min(vl, vr);
    }
};

int main() {
    int n,q;
    cin>>n>>q;
    vector<ll> v(1001001,LINF);
    LazySegmentTree segt(v);
    vector<int> vec;
    vector<tuple<int,int,int>> tup(n);
    rep(i,n) {
        int s,t,x;
        cin>>s>>t>>x;
        tup[i]=make_tuple(x,s,t);
        vec.push_back(max(0,s-x));
        vec.push_back(max(0,t-x));
    }
    vector<int> d(q);
    rep(i,q) {
        cin>>d[i];
        vec.push_back(d[i]);
    }
    sort(all(vec));
    get_unique(vec);
    
    sort(all(tup));
    reverse(all(tup));
    rep(i,n) {
        int s,t,x;
        tie(x,s,t)=tup[i];
        int l=lower_bound(all(vec),max(0,s-x))-vec.begin();
        int r=lower_bound(all(vec),max(0,t-x))-vec.begin();
        segt.update(l,r,x);
    }
    
    rep(i,q) {
        int D=lower_bound(all(vec),d[i])-vec.begin();
        ll ans=segt.getmin(D,D+1);
        cout<<(ans==LINF ? -1 : ans)<<endl;
    }
    
}


Measured memory_bytes: 52848