#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")

#include <bits/stdc++.h>

// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i,n) for (long long i=0, i##_len=(n); i<i##_len; i++)
#define RANGE(i,is,ie) for (long long i=(is), i##_end=(ie); i<=i##_end; i++)
#define DSRNG(i,is,ie) for (long long i=(is), i##_end=(ie); i>=i##_end; i--)
#define UNIQUE(v) { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); }
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return true;} return false; }
template<class T> bool chmin(T &a, const T &b) {if (a > b) {a = b; return true;} return false; }
#define INF 0x7FFFFFFF
#define LINF 0x7FFFFFFFFFFFFFFFLL
#define Yes(q) (q ? "Yes" : "No")
#define YES(q) (q ? "YES" : "NO")
#define DUMP(q) cerr << "[DEBUG] " #q ": " << (q) << " at " __FILE__ ":" << __LINE__ << endl
#define DUMPALL(q) { cerr << "[DEBUG] " #q ": ["; REP(dumpall_i, (q).size()) { cerr << q[dumpall_i] << (dumpall_i == (q).size() - 1 ? "" : ", "); } cerr << "] at " __FILE__ ":" << __LINE__ << endl; }
template<class T> T gcd(const T &a, const T &b) { return a < b ? gcd(b, a) : b ? gcd(b, a % b) : a; }
template<class T> T lcm(const T &a, const T &b) { return a / gcd(a, b) * b; }

// gcc拡張マクロ
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll

// エイリアス
using  ll = long long;
using ull = unsigned long long;
using  ld = long double;
using namespace std;

// モジュール
// 引用: http://tsutaj.hatenablog.com/entry/2017/03/30/224339
struct LazySegmentTree {
private:
    ll n;
    vector<ll> node, lazy;
    vector<bool> lazyFlag;
 
public:
    LazySegmentTree(vector<ll> v) {
        ll sz = (ll)v.size();
        n = 1; while(n < sz) n *= 2;
        node.resize(2*n-1);
        lazy.resize(2*n-1, INF);
        lazyFlag.resize(2*n-1, false);
 
        for(ll i=0; i<sz; i++) node[i+n-1] = v[i];
        for(ll i=n-2; i>=0; i--) node[i] = min(node[i*2+1], node[i*2+2]);
    }
 
    void lazyEvaluate(ll k, ll l, ll r) {
        if(lazyFlag[k]) {
            node[k] = lazy[k];
            if(r - l > 1) {
                lazy[k*2+1] = lazy[k*2+2] = lazy[k];
                lazyFlag[k*2+1] = lazyFlag[k*2+2] = true;
            }
            lazyFlag[k] = false;
        }
    }
 
    void update(ll a, ll b, ll x, ll k=0, ll l=0, ll r=-1) {
        if(r < 0) r = n;
        lazyEvaluate(k, l, r);
        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[k] = x;
            lazyFlag[k] = true;
            lazyEvaluate(k, l, r);
        }
        else {
            update(a, b, x, 2*k+1, l, (l+r)/2);
            update(a, b, x, 2*k+2, (l+r)/2, r);
            node[k] = min(node[2*k+1], node[2*k+2]);
        }
    }
 
    ll find(ll a, ll b, ll k=0, ll l=0, ll r=-1) {
        if(r < 0) r = n;
        lazyEvaluate(k, l, r);
        if(b <= l || r <= a) return INF;
        if(a <= l && r <= b) return node[k];
        ll vl = find(a, b, 2*k+1, l, (l+r)/2);
        ll vr = find(a, b, 2*k+2, (l+r)/2, r);
        return min(vl, vr);
    }
};

// 処理内容
int main() {
    
    ll n, q; cin >> n >> q;
    vector<ll> s(n), t(n), x(n);
    vector<ll> rank(n); iota(ALL_OF(rank), 0LL);
    REP(i, n) {
        cin >> s[i] >> t[i] >> x[i];
    }
    sort(ALL_OF(rank), [&x](ll i, ll j) -> bool {
        return x[i] > x[j];
    });

    vector<ll> d(q), ans(q, INF);
    REP(i, q) cin >> d[i];
    vector<ll> unq = d;
    map<ll, ll> sahz;
    UNIQUE(unq);
    REP(i, unq.size()) sahz[unq[i]] = i;
    
    vector<ll> emp = vector<ll>(unq.size(), INF);
    LazySegmentTree sg(emp);
    ll zerox = -1;
    REP(_i, n) {
        ll i = rank[_i];
        ll l = lower_bound(ALL_OF(unq), s[i] - x[i]) - unq.begin();
        ll r = lower_bound(ALL_OF(unq), t[i] - x[i]) - unq.begin();
        sg.update(l, r, x[i]);
    }
    REP(i, q) {
        ll j = sahz[d[i]];
        ll ans = sg.find(j, j+1);
        if (ans == INF) ans = -1;
        cout << ans << endl;
    }
    
}

Measured memory_bytes: 35172