#include <bits/stdc++.h>
using namespace std;

// macros
#define overload_rep(_1, _2 ,_3 ,name, ...) name
#define re_p(i, n) for(int i = 0; i < (n); ++i)
#define r_ep(i, x, y) for(int i = (x); i <= (y); ++i)
#define rep(...) overload_rep(__VA_ARGS__, r_ep, re_p)(__VA_ARGS__)
#define all(a) a.begin(), a.end()
#ifndef STOP_DEBUG
#define debug(...)\
    do { cerr << boolalpha << "[" << #__VA_ARGS__ << "]:";\
    debug_cerr(__VA_ARGS__); cerr << noboolalpha; } while (0)
#else
#define debug(...)
#endif

// functions
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 debug_cerr(){ cerr << '\n'; }
template<class Head, class... Tail>
void debug_cerr(Head head, Tail... tail){
    cerr << ' ' << head;
    debug_cerr(tail...);
}

// cin/cout setup
struct IoSetup{
    IoSetup(){
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} iosetup;

// Let's get AC!

template<class Monoid, class Effector>
struct LazySegmentTree{
private:

    int sz, height;
    vector<Monoid> node;
    vector<Effector> lazy;
    using Func_M = function<Monoid(Monoid, Monoid)>;
    using Func_E = function<Effector(Effector, Effector)>;
    using Merge = function<Monoid(Monoid, Effector, int)>;
    const Func_M operate_m;
    const Func_E operate_e;
    const Merge merge;
    const Monoid unit_m;
    const Effector unit_e;

    inline Monoid reflect(int i, int l){
        return lazy[i] == unit_e ? node[i] : merge(node[i], lazy[i], l);
    }

    inline void propagate(int i, int l){
        if(lazy[i] == unit_e)return;
        if(i < sz){
            lazy[i << 1] = operate_e(lazy[i << 1], lazy[i]);
            lazy[i << 1 | 1] = operate_e(lazy[i << 1 | 1], lazy[i]);
        }
        node[i] = merge(node[i], lazy[i], l);
        lazy[i] = unit_e;
    }

public:

    LazySegmentTree(){}
    LazySegmentTree(const Monoid m, const Effector e, const Func_M f1, const Func_E f2, const Merge f3) 
        : unit_m(m), unit_e(e), operate_m(f1), operate_e(f2), merge(f3) {}
    LazySegmentTree(const vector<Monoid>& vec, const Monoid m, const Effector e, const Func_M f1, const Func_E f2, const Merge f3) 
        : unit_m(m), unit_e(e), operate_m(f1), operate_e(f2), merge(f3) { bulid(vec); }
    ~LazySegmentTree(){}

    inline void init(){
        fill(node.begin(), node.end(), unit_m);
        fill(lazy.begin(), lazy.end(), unit_e);
    }

    inline void bulid(const vector<Monoid>& vec){
        for(sz = 1, height = 0; sz < (int)vec.size(); sz <<= 1, ++height);
        node.assign(sz << 1, unit_m);
        lazy.assign(sz << 1, unit_e);
        for(int i = 0; i < (int)vec.size(); ++i)
            node[i + sz] = vec[i];
        for(int i = sz - 1; i > 0; --i)
            node[i] = operate_m(node[i << 1], node[i << 1 | 1]);
    }

    inline void effect(int l, int r, Effector v){
        l += sz, r += sz - 1;
        for(int i = height; 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)propagate(tl, i), lazy[tl] = operate_e(lazy[tl], v), propagate(tl++, i);
            if(tr & 1)propagate(--tr, i), lazy[tr] = operate_e(lazy[tr], v), propagate(tr, i);
        }
        for(int tl = l >> 1, tr = r >> 1, i = 0; tl > 0; tl >>= 1, tr >>= 1, ++i){
            node[tl] = operate_m(reflect(tl << 1, 1 << i), reflect(tl << 1 | 1, 1 << i));
            node[tr] = operate_m(reflect(tr << 1, 1 << i), reflect(tr << 1 | 1, 1 << i));
        }
    }

    inline Monoid fold(int l, int r){
        Monoid vl = unit_m, vr = unit_m;
        l += sz, r += sz - 1;
        for(int i = height; 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)vl = operate_m(vl, reflect(tl++, i));
            if(tr & 1)vr = operate_m(reflect(--tr, i), vr);
        }
        return operate_m(vl, vr);
    }

    inline Monoid operator [] (int i){
        return fold(i, i + 1);
    }

};

typedef long long ll;
const int unit_m = INT_MAX;
const int unit_e = INT_MAX;

int main(){

    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];

    auto f1 = [](int x, int y){
        return min(x, y);
    };

    auto f2 = [](int x, int y){
        return min(x, y);
    };

    auto f3 = [](int x, int y, int l){
        return min(x, y);
    };

    vector<int> build(Q, unit_m);
    LazySegmentTree<int, int> seg(build, unit_m, unit_e, f1, f2, f3);

    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.effect(left, right, xx);
    }

    rep(i, Q){
        int ans = seg[i];
        if(ans == unit_m)cout << -1 << '\n';
        else cout << ans << '\n';
    }

}

Measured memory_bytes: 9984