#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
using namespace std;

using LL=signed long long;

const LL INF=2000000000;
class LazySegmentTree{
public:
    LL size;
    LL realsize;
    LL tree_default=INF;
    LL change_default=-1;
    vector<LL> tree;
    vector<LL> change;
    LazySegmentTree(LL n){
        size=n;
        realsize=1;
        while(realsize<size) realsize*=2;
        tree.resize(2*realsize);
        for(auto &&v: tree) v=INF;
        change.resize(2*realsize);
        for(auto &&v: change) v=change_default;
    }
    LL merge(LL a,LL b, LL c){
        return c!=change_default ? c : (a<b ? a : b);
    }
    void _change_range(LL a, LL b, LL k, LL l, LL r, LL x, LL propergate_x){
        if(r<=a || b<=l){
            if(propergate_x!=change_default) change[k]=propergate_x;
            tree[k]=merge(tree[k],tree_default,change[k]);
            return;
        }
        if(a<=l && r<=b){
            change[k]=x;
            tree[k]=merge(tree[k],tree_default,change[k]);
            return;
        }
        if(propergate_x==change_default) propergate_x=change[k];
        _change_range(a,b,2*k,l,(l+r)/2,x,propergate_x);
        _change_range(a,b,2*k+1,(l+r)/2,r,x,propergate_x);
        change[k]=change_default;
        tree[k]=merge(tree[2*k],tree[2*k+1],change[k]);
    }
    void change_range(LL a, LL b, LL x){
        _change_range(a,b,1,0,realsize,x,change_default);
    }
    LL _get_min(LL a,LL b,LL k,LL l,LL r){
        if(r<=a || b<=l) return tree_default;
        if(a<=l && r<=b) return tree[k];
        LL vl=_get_min(a,b,2*k,l,(l+r)/2);
        LL vr=_get_min(a,b,2*k+1,(l+r)/2,r);
        return merge(vl,vr,change[k]);
    }
    LL get_min(LL a,LL b){
        return _get_min(a,b,1,0,realsize);
    }

};

LL _lower_bound(vector<LL> &array,LL value,LL l, LL r){
    if(r==l) return l;
    LL ind=(r+l)/2;
    return value<=array[ind] ? _lower_bound(array,value,l,ind) : _lower_bound(array,value,ind+1,r);
}

LL lower_bound(vector<LL> &array,LL value){
    return value>array[array.size()-1] ? array.size() : _lower_bound(array,value,0,array.size()-1);
}


int main(void){
    LazySegmentTree lst=LazySegmentTree(1<<19);
    LL N,Q;
    cin >> N >> Q;
    map<LL,LL> point_compress;
    vector<LL> points;
    vector<vector<LL>> events;

    for(LL i=0;i<N;i++){
        LL s,t,x;
        cin >> s >> t >> x;
        points.push_back(s-x);
        points.push_back(t-x);
        vector<LL> event={s,t,x};
        events.push_back(event);
    }
    sort(points.begin(),points.end());
    vector<LL> uniq_points;
    LL old=-INF;
    for(auto &&v: points){
        if(v!=old) uniq_points.push_back(v);
        old=v;
    }
    for(LL i=0;i<uniq_points.size();i++){
        point_compress[uniq_points[i]]=i;
    }
    sort(events.begin(),events.end(),[](const vector<LL> &a,const vector<LL> &b){
        return a[2]>b[2];
    });
    for(int i=0;i<N;i++){
        LL s,t,x;
        s=events[i][0];
        t=events[i][1];
        x=events[i][2];
        lst.change_range(point_compress[s-x],point_compress[t-x],x);
    }
    for(LL i=0;i<Q;i++){
        LL x;
        cin >> x;
        LL index=lower_bound(uniq_points,x);
        if(x<uniq_points[0] || index==uniq_points.size()){
            cout << -1 << endl;
            continue;
        }
        LL point;
        if(uniq_points[index]==x){
            point=uniq_points[index];
        }else{
            point=uniq_points[index-1];
        }
        LL temp=lst.get_min(point_compress[point],point_compress[point]+1);
        if(temp==INF){
            cout << -1 << endl;
        }else{
            cout << temp << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 61404