#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

// 座標圧縮遅延評価セグメント木
// 任意の範囲における区間 min を求めることが可能
// ただし、座圧する関係上 Build() 後の Update が不可能
class CompLazySegmentTree {
    private:
        class LazySegmentTreeImpl {
            private:
                enum Status { None = 0, Update_Min = 1, Update_Reset = 2 };
            public:
                LazySegmentTreeImpl() : m_E(LLINF) {}
                LazySegmentTreeImpl(ll n) : m_E(LLINF) { Init(n); }
                void Init(ll n) {
                    m_Size = 1;
                    while(m_Size < n) { m_Size <<= 1; }
                    m_Seg.assign(2 * m_Size, m_E);
                    m_Lazy.assign(2 * m_Size, m_E);
                    m_LazyFlag.assign(2 * m_Size, None);
                }
                void Update(ll a, ll b, ll x) {
                    assert(0 <= a && a < b && b < m_Size);
                    MinImpl(a, b, x, 1, 0, m_Size);
                }
                ll Query(ll a, ll b) {
                    assert(0 <= a && a < b && b < m_Size);
                    return QueryImpl(a, b, 1, 0, m_Size);
                }

            private:
                void Propagate(ll k, ll length) {
                    if(m_LazyFlag[k] == Update_Min) {
                        if(k < m_Size) {
                            if(m_LazyFlag[2 * k + 0] == Update_Reset) { Propagate(2 * k + 0, length / 2); }
                            if(m_LazyFlag[2 * k + 1] == Update_Reset) { Propagate(2 * k + 1, length / 2); }
                            m_Lazy[2 * k + 0] = min(m_Lazy[2 * k + 0], m_Lazy[k]);
                            m_Lazy[2 * k + 1] = min(m_Lazy[2 * k + 1], m_Lazy[k]);
                            m_LazyFlag[2 * k + 0] = m_LazyFlag[2 * k + 1] = Update_Min;
                        }
                        m_Seg[k] = min(m_Seg[k], m_Lazy[k]);
                        m_Lazy[k] = m_E;
                        m_LazyFlag[k] = None;
                    }
                    else if(m_LazyFlag[k] == Update_Reset) {
                        if(k < m_Size) {
                            m_Lazy[2 * k + 0] = m_Lazy[2 * k + 1] = m_Lazy[k];
                            m_LazyFlag[2 * k + 0] = m_LazyFlag[2 * k + 1] = Update_Reset;
                        }
                        m_Seg[k] = m_Lazy[k];
                        m_Lazy[k] = m_E;
                        m_LazyFlag[k] = None;
                    }
                }
                void MinImpl(ll a, ll b, ll x, ll k, ll l, ll r) {
                    Propagate(k, r - l);
                    if(b <= l || r <= a) { return; }
                    if(a <= l && r <= b) {
                        m_Lazy[k] = x;
                        m_LazyFlag[k] = Update_Min;
                        Propagate(k, r - l);
                    }
                    else {
                        MinImpl(a, b, x, 2 * k + 0, l, (l + r) >> 1);
                        MinImpl(a, b, x, 2 * k + 1, (l + r) >> 1, r);
                        m_Seg[k] = min(m_Seg[2 * k + 0], m_Seg[2 * k + 1]);
                    }
                };
                ll QueryImpl(ll a, ll b, ll k, ll l, ll r) {
                    Propagate(k, r - l);
                    if(b <= l || r <= a) { return LLINF; }
                    if(a <= l && r <= b) { return m_Seg[k]; }
                    return min(QueryImpl(a, b, 2 * k + 0, l, (l + r) >> 1),
                            QueryImpl(a, b, 2 * k + 1, (l + r) >> 1, r));
                }

            private:
                const ll m_E;
                ll m_Size;
                vector<ll> m_Seg;
                vector<ll> m_Lazy;
                vector<ll> m_LazyFlag;
        };

        class CoordCompImpl {
            public:
                void Add(ll v) { m_V.push_back(v); }
                void Build() {
                    sort(m_V.begin(), m_V.end());
                    m_V.erase(unique(m_V.begin(), m_V.end()), m_V.end());
                    m_Decomp.assign(m_V.size() * 2 + 1, 0);
                    for(int i = 0; i < m_V.size(); ++i) {
                        m_Comp[m_V[i]] = i * 2 + 1;
                        m_Decomp[i * 2 + 1] = m_V[i];
                    }
                    assert(m_Decomp.size() >= 3);
                    m_Decomp[0] = m_Decomp[1] - 1;
                    m_Decomp[m_Decomp.size()-1] = m_Decomp[m_Decomp.size()-2] + 1;
                    for(int i = 1; i < m_V.size(); ++i) {
                        m_Decomp[i*2] = (m_Decomp[i*2-1] + m_Decomp[i*2+1]) / 2;
                    }
                }
                ll GetComp(ll n) {
                    if(m_Comp.count(n) > 0) { return m_Comp[n]; }
                    if(n < m_V[0]) { return 0; }
                    if(m_V[m_V.size()-1] < n) { return m_V.size() * 2; }
                    auto it = upper_bound(m_Decomp.begin(), m_Decomp.end(), n);
                    return static_cast<ll>(it - m_Decomp.begin()) - 1;
                }
                size_t GetSize() { return m_Decomp.size(); }
            private:
                vector<ll> m_V;
                map<ll, ll> m_Comp;
                vector<ll> m_Decomp;
        };

    public:

        // [l, r) を n で更新します (0-indexed) O(log N)
        void Update(ll l, ll r, ll n) {
            if(l > r) { swap(l, r); }
            if(m_PosVal.count(make_pair(l, r)) > 0) {
                m_PosVal[make_pair(l, r)] = min(m_PosVal[make_pair(l, r)], n);
            }
            else {
                m_PosVal[make_pair(l, r)] = n;
            }
            m_Cc.Add(l);
            m_Cc.Add(r);
        }
        // セグ木を構築します O(N log N)
        void Build() {
            m_Cc.Build();
            m_SegTree.Init(m_Cc.GetSize());
            for(auto& pv : m_PosVal) {
                ll lb = m_Cc.GetComp(pv.first.first);
                ll rb = m_Cc.GetComp(pv.first.second);
                ll val = pv.second;     // 位置に設定された値
                m_SegTree.Update(lb, rb, val);
            }
        }
        // 区間 [a, b) の最小値を取得します (0-indexed) O(log log N)
        ll Query(ll a, ll b) {
            ll comp_a = m_Cc.GetComp(a);
            ll comp_b = m_Cc.GetComp(b);
            if(a < b && comp_a == comp_b) { comp_b++; }
            return m_SegTree.Query(comp_a, comp_b);
        }

    private:
        map< pair<ll, ll>, ll> m_PosVal;    // 範囲 [l, r) にセットされた値
        LazySegmentTreeImpl m_SegTree;      // セグ木
        CoordCompImpl m_Cc;                 // 座圧クラス
};

ll N, Q;
vector<ll> S, T, X, D;

vector<ll> solve() {
    CompLazySegmentTree clst;
    REP(i, N) {
        ll lb = S[i] - X[i];
        ll ub = T[i] - X[i];
        clst.Update(lb, ub, X[i]);
    }
    clst.Build();

    vector<ll> ret;
    REP(i, Q) {
        ll val = clst.Query(D[i], D[i]+1);
        ret.push_back(val == LLINF ? -1 : val);
    }
    return ret;
}

signed main()
{
    cin >> N >> Q;
    S.resize(N);
    T.resize(N);
    X.resize(N);
    D.resize(Q);
    REP(i, N) { cin >> S[i] >> T[i] >> X[i]; }
    REP(i, Q) { cin >> D[i]; }

    vector<ll> ans = solve();
    for(auto& a : ans) { printf("%lld\n", a); }

    return 0;
}


Measured memory_bytes: 106092