#include<bits/stdc++.h>
using namespace std;
//#include<boost/multiprecision/cpp_int.hpp>
//using boost::multiprecision::cpp_int;

#define int long long
#define cint cpp_int
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) (((a)+(b)-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/2
#define PI acos(-1.0)

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;
typedef priority_queue<int> PQi;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vout(Vs &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vvout(VVi &v){for(int i=0;i<(v).size();i++) vout(v[i]);}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
int mypow(int x, int n, int m){if(n==0)return 1;if(n%2==0)return mypow(x*x%m,n/2,m);else return x*mypow(x,n-1,m)%m;}
int digit(int k,int i){string s = to_string(k);return s[s.size()-i]-'0';}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());} //vectorの同じ要素消す
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
int leng(int n){string s=to_string(n); return s.size();} //intの桁数
int digitsum(int n){int ret=0; while(n>0){ret+=n%10;n/=10;}return ret;} //桁和
int lesscount(int x,Vi &a){return lower_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx未満の数の個数
int orlesscount(int x,Vi &a){return upper_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx以下の数の個数
int morecount(int x,Vi &a){return a.size()-orlesscount(x,a);} //vector aにおけるxより大きい数の個数
int ormorecount(int x,Vi &a){return a.size()-lesscount(x,a);} //vector aにおけるx以上の数の個数
int count(int x,Vi &a) {return upper_bound(ALL(a),x)-lower_bound(ALL(a),x);} //vector aにおけるxの個数
Vi accum(Vi &v){Vi ret((v).size()+1);REP(i,0,(v).size()) ret[i+1]=ret[i]+v[i];return ret;}
// bool comp(Pii a,Pii b){
//     if(a.second != b.second) return a.second<b.second;
//     else return a.first<b.first;
// }
bool comp(Tiii a,Tiii b){
    return get<2>(a) > get<2>(b);
}


struct SegmentTree {
    int n;
    vector<int> node,lazy;

    SegmentTree(vector<int> v){
        int sz = v.size();
        n = 1;
        while(n < sz) n*=2;
        node.resize(2*n-1, INF);
        lazy.resize(2*n-1, 0);
        
        REP(i,0,sz) node[i+n-1] = v[i];
        REPR(i,n-2,-1) node[i] = min(node[2*i+1], node[2*i+2]);
    }

    void eval(int k, int l, int r) {
        if(lazy[k] != 0) {
            node[k] = lazy[k];
            if(r - l > 1) {
                lazy[2*k+1] = lazy[k];
                lazy[2*k+2] = lazy[k];
            }
            lazy[k] = 0;
        }
    }

    void update(int a, int b, ll x, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        eval(k, l, r);

        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[k] = x;
            eval(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]);
        }
    }    

    int getmin(int a, int b, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        if(r <= a || b <= l) return INF;

        eval(k, l, r);
        if(a <= l && r <= b) return node[k];
        int vl = getmin(a, b, 2*k+1, l, (l+r)/2);
        int vr = getmin(a, b, 2*k+2, (l+r)/2, r);
        return min(vl, vr);
    }
};

signed main(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);
    int n,q;
    cin>>n>>q;
    Vi s(n),t(n),x(n),d(q);
    vector<Tiii> T(n);
    REP(i,0,n){
        int t1,t2,t3;
        cin>>t1>>t2>>t3;
        T[i]=mt(t1,t2,t3);
    }
    REP(i,0,q) cin>>d[i];
    sort(ALL(T),comp);
    REP(i,0,n){
        s[i]=get<0>(T[i]);
        t[i]=get<1>(T[i]);
        x[i]=get<2>(T[i]);
    }

    Vi a(q,INF);
    SegmentTree seg(a);

    REP(i,0,n){
        int start=lower_bound(ALL(d),s[i]-x[i])-d.begin();
        int end=lower_bound(ALL(d),t[i]-x[i])-d.begin();
        seg.update(start,end,x[i]);
    }
    REP(i,0,q){
        if(seg.getmin(i,i+1)!=INF) cout<<seg.getmin(i,i+1)<<endl;
        else cout<<-1<<endl;
    }
    return 0;
}


Measured memory_bytes: 22628