#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

template <typename E>
struct dual_segment_tree {
    using H = function<E(E, E)>;
    int n, height;
    H h;
    E ei;
    vector<E> lazy;
    dual_segment_tree(H h, E ei) : h(h), ei(ei) {}
    void init(int n_) {
        n = 1; height = 0;
        while (n < n_) n <<= 1, height++;
        lazy.assign(2*n, ei);
    }
    inline void propagete(int i) {
        if (lazy[i] == ei) return;
        lazy[i<<1|0] = h(lazy[i<<1|0], lazy[i]);
        lazy[i<<1|1] = h(lazy[i<<1|1], lazy[i]);
        lazy[i] = ei;
    }
    inline void thrust(int i) {
        for (int k = height; k >= 1; --k) propagete(i>>k);
    }
    void update(int a, int b, E x) {
        a += n; b += n;
        thrust(a);
        thrust(b-1);
        int l = a, r = b;
        while (l < r) {
            if (l & 1) lazy[l] = h(lazy[l], x), l++;
            if (r & 1) --r, lazy[r] = h(lazy[r], x);
            l >>= 1; r >>= 1;
        }
    }
    E get_val(int i) {
        i += n;
        thrust(i);
        return lazy[i];
    }
};

template <typename T>
struct compress {
    vector<T> xs;
    compress(const vector<T> vs) {
        xs = vs;
        sort(xs.begin(), xs.end());
        xs.erase(unique(xs.begin(), xs.end()), xs.end());
    }
    vector<int> get(const vector<T> &vs) const {
        vector<int> res;
        transform(vs.begin(), vs.end(), back_inserter(res),
                  [&](const T &x) { return lower_bound(xs.begin(), xs.end(), x) - xs.begin();}
            );
        return res;
    }
    int get(const T &x) const {
        return lower_bound(xs.begin(), xs.end(), x) - xs.begin();
    }
    const T &operator[](int k) const { return xs[k];}
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, q;
    cin >> n >> q;
    vector<tuple<int, int, int>> xst;
    vector<int> time;
    rep(i, n) {
        int s, t, x;
        cin >> s >> t >> x;
        s = max(0, s - x);
        t = max(0, t - x);
        time.push_back(s);
        time.push_back(t);
        xst.emplace_back(x, s, t);
    }
    sort(rall(xst));
    vector<int> d(q);
    rep(i, q) cin >> d[i], time.push_back(d[i]);
    compress comp(time);
    int k = sz(comp.xs);
    
    auto f = [](int a, int b) { return b == -1 ? a : b;};
    dual_segment_tree<int> seg(f, -1);
    seg.init(k);

    rep(i, n) {
        int x, s, t;
        tie(x, s, t) = xst[i];
        s = comp.get(s);
        t = comp.get(t);
        seg.update(s, t, x);
    }
    rep(i, q) {
        cout << seg.get_val(comp.get(d[i])) << endl;
    }
}


Measured memory_bytes: 19344