#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii=pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c),end(c)
#define rall(c) rbegin(c),rend(c)
#define fore(x,c) for(auto &&x:c)
#define rep(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define rrep(i, a, n) for(int i=(int)(n-1);i>=a;--i)
#define sz(c) ((int)c.size())
#define contains(c,x) (c.find(x)!=end(c))
#define inseg(l,x,r) ((l)<=(x)&&(x)<(r))
#define dump(...)
#define pb push_back
#define _ 0
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(nullptr); ios::sync_with_stdio(0);
        cout << setprecision(15) << fixed;
        // #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

template <class T>
struct LazySegmentTree {
    const T query_ident = 0;
    const T prop_ident = INF;
    int size;
    vector<T> data;
    vector<T> lazy;
    vi width;

    LazySegmentTree(int n) {
        size = 1;
        while (size < n) size *= 2;
        data.assign(size * 2, query_ident);
        lazy.assign(size * 2, prop_ident);
        width.assign(size * 2, 1);
        rrep(k, 0, size - 1) {
            width[k] = width[k * 2 + 1] + width[k * 2 + 2];
        }
    }
    void lazy_propagate(int k) {
        if (lazy[k] == prop_ident) return;
        data[k] = lazy[k] * width[k];  // !
        if (k < size - 1) {
            lazy[k * 2 + 1] = lazy[k];  // !
            lazy[k * 2 + 2] = lazy[k];  // !
        }
        lazy[k] = prop_ident;
    }
    void range_update(int ql, int qr, T value) {
        range_update(ql, qr, value, 0, 0, size);
    }
    void range_update(int ql, int qr, T value, int k, int nl, int nr) {
        if (qr <= nl || nr <= ql) {
            lazy_propagate(k);
            return;
        }
        if (ql <= nl && nr <= qr) {
            lazy[k] = value;  // !
            lazy_propagate(k);
            return;
        }
        lazy_propagate(k);
        int nm = (nl + nr) / 2;
        range_update(ql, qr, value, k * 2 + 1, nl, nm);
        range_update(ql, qr, value, k * 2 + 2, nm, nr);
        data[k] = data[k * 2 + 1] + data[k * 2 + 2];  // !
    }
    T range_sum(int ql, int qr) {
        return range_sum(ql, qr, 0, 0, size);
    }
    T range_sum(int ql, int qr, int k, int nl, int nr) {
        if (qr <= nl || nr <= ql) {
            return query_ident;
        }
        if (ql <= nl && nr <= qr) {
            lazy_propagate(k);
            return data[k];
        }
        lazy_propagate(k);
        int nm = (nl + nr) / 2;
        T res_l = range_sum(ql, qr, k * 2 + 1, nl, nm);
        T res_r = range_sum(ql, qr, k * 2 + 2, nm, nr);
        return res_l + res_r;  // !
    }
};
signed main() {
    int N, Q;
    cin >> N >> Q;
    vector<pair<int, pii>> range(N);
    vi zip;
    rep(i, 0, N) {
        int s, t, x;
        cin >> s >> t >> x;
        range[i] = make_pair(x, pii(s - x, t -x));
        zip.pb(s - x);
        zip.pb(t - x);
    }
    sort(all(range));

    vi D(Q);
    rep(i, 0, Q) {
        cin >> D[i];
        zip.pb(D[i]);
    }

    sort(all(zip)); zip.erase(unique(all(zip)), zip.end());
    auto get = [&](int d) { return lower_bound(all(zip), d) - zip.begin(); };

    LazySegmentTree<int> seg(sz(zip));
    rrep(i, 0, N) {
        int l, r;
        tie(l, r) = range[i].second;
        seg.range_update(get(l), get(r), range[i].first);
    }
    rep(i, 0, Q) {
        int ans = seg.range_sum(get(D[i]), get(D[i]) + 1);
        if (ans == 0) cout << -1 << endl;
        else cout << ans << endl;
    }
    return (0^_^0);
}



Measured memory_bytes: 62952