#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i ++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PL;
typedef pair<int,int> P;
const ll INF = 1e11;
const int MOD = 1e9 + 7;
const vector<int> dy = {-1,0,1,0};
const vector<int> dx = {0,1,0,-1};



template <class Monoid1,class Monoid2> class LazySegmentTree {
    int N;
    vector<Monoid1> tree;
    vector<Monoid2> lazy;
    function<Monoid1(Monoid1,Monoid1)> fx = [](Monoid1 x1,Monoid1 x2){return min(x1,x2);};
    function<Monoid1(Monoid1,Monoid2)> fa = [](Monoid1 x,Monoid2 m){return min(x,m);};
    function<Monoid2(Monoid2,Monoid2)> fm = [](Monoid2 m1,Monoid2 m2){return min(m1,m2);};
    Monoid1 unit_x;
    Monoid2 unit_m;
    
    private :
    void _build(vector<Monoid1> array) {
        for (int i = N; i < 2*N; i++) tree[i] = array[i - N];
        for (int i = N - 1; i > 0; i--) tree[i] = fx(tree[i << 1],tree[i << 1|1]);
    }

    void _evaluate(int k) {
        int H = 0;
        while ((1 << (H + 1)) <= k) H ++;
        for (int i = H; i > 0; i--) {
            int t = k >> i;
            tree[t] = fa(tree[t],lazy[t]);
            lazy[t << 1] = fm(lazy[t << 1],lazy[t]);
            lazy[t << 1|1] = fm(lazy[t << 1|1],lazy[t]);
            lazy[t] = unit_m;
        }
    }

    void _caluculate(int k) {
        while (k > 1) {
            k >>= 1;
            Monoid1 a = fa(tree[k << 1],lazy[k << 1]);
            Monoid1 b = fa(tree[k << 1|1],lazy[k << 1|1]);
            tree[k] = fx(a,b);
        }
    }

    public :
    LazySegmentTree(int _N,Monoid1 _unitx,Monoid2 _unitm) :N(_N),unit_x(_unitx),unit_m(_unitm) {
        tree = vector<Monoid1>(2*N,unit_x);
        lazy = vector<Monoid2>(2*N,unit_m);
        //_build(array);
    }

    void range_update(int L, int R,Monoid2 x) {
        L += N; R += N;
        int L0 = L/(L & -L);
        int R0 = R/(R & -R) - 1;
        //_evaluate(L0);
        //_evaluate(R0);
        while (L < R) {
            if (L&1) lazy[L] = fm(lazy[L],x),L ++;
            if (R&1) R--,lazy[R] = fm(lazy[R],x);
            R >>= 1; L >>= 1;
        }
        _caluculate(L0);
        _caluculate(R0);
    }

    Monoid1 range_query(int L,int R) {
        L += N; R += N;
        int L0 = L/(L & -L);
        int R0 = R/(R & -R) - 1;
        _evaluate(L0);
        _evaluate(R0);
        Monoid1 vl = unit_x;
        Monoid1 vr = unit_x;
        while (L < R) {
            if (L&1) vl = fx(vl,fa(tree[L],lazy[L])),L ++;
            if (R&1) R --,vr = fx(fa(tree[R],lazy[R]),vr);
            L >>= 1; R >>= 1;
        }
        return fx(vl,vr);
    } 

    vector<Monoid1> answer(){
        for (int i = 0;i < N;i++){
            tree[i] = fa(tree[i],lazy[i]);
            lazy[i << 1] = fm(lazy[i << 1],lazy[i]);
            lazy[i << 1|1] = fm(lazy[i << 1|1],lazy[i]);
            lazy[i] = unit_m;
        }
        vector<Monoid1> ans(N);
        for (int i = N;i < 2*N;i++){
            ans[i - N] = fa(tree[i],lazy[i]);
            if (ans[i - N] == unit_x) ans[i - N] = -1;
        }
        return ans;
    }

    void debug(){
        printf("tree\n");
        for (int i = 0;i < 2*N;i++) printf(" %ld",tree[i]);
        printf("\n");
        printf("lazy\n");
        for (int i = 0;i < 2*N;i++) printf(" %ld",lazy[i]);
        printf("\n");
    }
};

int main() {
    int N,Q; scanf("%d %d",&N,&Q);
    vector<vector<ll>> roadwork(N,vector<ll>(3));
    rep(i,N) scanf("%d %d %d",&roadwork[i][0],&roadwork[i][1],&roadwork[i][2]);
    vector<int> D(Q);
    rep(i,Q) scanf("%d",&D[i]);

    LazySegmentTree<ll,ll> st(Q,INF,INF);
    rep(i,N){
        ll s = roadwork[i][0],t = roadwork[i][1],x = roadwork[i][2];
        int L = lower_bound(D.begin(),D.end(),s - x) - D.begin();
        int R = lower_bound(D.begin(),D.end(),t - x) - D.begin();
        st.range_update(L,R,x);
    }
    vector<ll> ans = st.answer();
    rep(i,Q) printf("%ld\n",ans[i]);
}


Measured memory_bytes: 21376