#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define int long long
#define double long double
#define all(a) a.begin(), a.end()
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; }
using namespace std;

template<typename Monoid>
struct LazySegmentTree{   //遅延評価セグメント木 (1-indexed)
private:
    int sz = 1, hei = 0;
    vector<Monoid> node, lazy;
    using Func1 = function<Monoid(Monoid, Monoid)>;         //同一の配列内の二つの値どうしの演算
    using Func2 = function<Monoid(Monoid, Monoid, int)>;    //遅延配列の値をマージする演算
    const Func1 pick_n, pick_l; const Func2 merge;
    const Monoid init_n, init_l;
public:
    LazySegmentTree(vector<Monoid> vec, Monoid m1, const Monoid m2, 
                    const Func1 f1, const Func1 f2, const Func2 f3)
                    : init_n(m1), init_l(m2), pick_n(f1), pick_l(f2), merge(f3) {
        while(sz < (int)vec.size())sz <<= 1, ++hei;
        node = vector<Monoid>(sz << 1, init_n);
        lazy = vector<Monoid>(sz << 1, init_l);
        for(int i = 0; i < (int)vec.size(); i++){
            node[i + sz] = vec[i];
        }
        for(int i = sz - 1; i >= 1; i--){
            node[i] = pick_n(node[i << 1], node[i << 1 | 1]);
        }
    }
    inline void propagate(int i, int l){ //遅延配列を伝搬させる
        if(lazy[i] == init_l)return;
        if(i < sz){
            lazy[i << 1] = pick_l(lazy[i << 1], lazy[i]);
            lazy[i << 1 | 1] = pick_l(lazy[i << 1 | 1], lazy[i]);
        }
        node[i] = merge(node[i], lazy[i], l);
        lazy[i] = init_l;
    }
    void update(int l, int r, Monoid v){ //区間の値を全てある値に変える
        l += sz, r += sz - 1;
        for(int i = hei; i >= 0; i--){
            propagate(l >> i, 1 << i);
            propagate(r >> i, 1 << i);
        }
        for(int tl = l, tr = r + 1, i = 1; tl < tr; tl >>= 1, tr >>= 1, i <<= 1){
            if(tl & 1)lazy[tl] = pick_l(lazy[tl], v), propagate(tl++, i);
            if(tr & 1)lazy[--tr] = pick_l(lazy[tr], v), propagate(tr, i);
        }
        int i = 0;
        while(l >>= 1, r >>= 1, l > 0){
            node[l] = pick_n(reflect(l << 1, 1 << i), reflect(l << 1 | 1, 1 << i));
            node[r] = pick_n(reflect(r << 1, 1 << i), reflect(r << 1 | 1, 1 << i));
            i++;
        }
    }
    Monoid get(int l, int r){ //区間取得
        Monoid res = init_n;
        l += sz, r += sz - 1;
        for(int i = hei; i >= 0; i--){
            propagate(l >> i, 1 << i);
            propagate(r >> i, 1 << i);
        }
        int i = 1;
        for(++r; l < r; l >>= 1, r >>= 1, i <<= 1){
            if(l & 1)propagate(l, i), res = pick_n(res, node[l++]);
            if(r & 1)propagate(--r, i), res = pick_n(res, node[r]);
        }
        return res;
    }
    inline Monoid reflect(int i, int l){
        return lazy[i] == init_l ? node[i] : merge(node[i], lazy[i], l);
    }
    inline Monoid operator [] (int i){ //[]でアクセス
        return get(i, i + 1);
    }
};

signed main(void){

    int n,q; cin >> n >> q;
    vector<int> s(n), t(n), x(n), d(q);
    rep(i, n)cin >> s[i] >> t[i] >> x[i];
    rep(i, q)cin >> d[i];

    const int inf = 1000000000000000;
    vector<int> v(q, inf);
    auto f = [](int x, int y){ return min<int>(x, y); }; 
    auto g = [](int x, int y){ return min<int>(x, y); };
    auto h = [](int x, int y, int l){ return min<int>(x, y); };

    LazySegmentTree<int> seg(v, inf, inf, f, g, h);
    rep(i, n){
        int ss = s[i], tt = t[i], xx = x[i];
        int left = lower_bound(all(d), ss - xx) - d.begin();
        int right = lower_bound(all(d), tt - xx) - d.begin();
        if(left >= right) continue;
        seg.update(left, right, xx);
    }

    rep(i, q){
        int ans = seg[i];
        if(ans == inf)cout << -1 << endl;
        else cout << ans << endl;
    }



}

Measured memory_bytes: 17892