#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
#include <climits>
using namespace std;
using ll = long long;

//===
template<typename Monoid, typename Laz>
struct LazySegmentTree {

    const function<Monoid(Monoid, Monoid)> mergeMonoid;
    const function<Monoid(Monoid, Laz, int)> applyLaz;
    const function<Laz(Laz, Laz)> mergeLaz;
    
    const Monoid e; // neutral element
    
    vector<Monoid> seg;
    vector<Laz> lazy;
    vector<bool> isUpdated;
    
    int size;
                                           
    LazySegmentTree(int nmemb, const Monoid &e,
                    function<Monoid(Monoid, Monoid)> f,
                    function<Monoid(Monoid, Laz, int)> g,
                    function<Laz(Laz, Laz)> h):
        e(e), mergeMonoid(f), applyLaz(g), mergeLaz(h)
    {
        size = 1;
        while (size < nmemb) {
            size *= 2;
        }

        seg.assign(2 * size - 1, e);
        isUpdated.assign(2 * size - 1, true);
        lazy.resize(2 * size - 1); 
    }

    inline void propagation(int k, int len) {
        if (!isUpdated[k]) {
            seg[k] = applyLaz(seg[k], lazy[k], len);
            if (len > 1) {
                if (isUpdated[2 * k + 1])
                    lazy[2 * k + 1] = lazy[k], isUpdated[2 * k + 1] = false;
                else
                    lazy[2 * k + 1] = mergeLaz(lazy[2 * k + 1], lazy[k]);
                
                if (isUpdated[2 * k + 2])
                    lazy[2 * k + 2] = lazy[k], isUpdated[2 * k + 2] = false;
                else 
                    lazy[2 * k + 2] = mergeLaz(lazy[2 * k + 2], lazy[k]);
            }
            isUpdated[k] = true;
        }
    }

    Monoid update(int k, int nl, int nr, int ql, int qr, Laz dat) {
        propagation(k, nr - nl);

        if (nr <= ql || qr <= nl) return seg[k];

        if (ql <= nl && nr <= qr) {
            lazy[k] = dat;
            isUpdated[k] = false;
            propagation(k, nr - nl);
            return seg[k];
        }
        else {
            seg[k] = mergeMonoid(update(2 * k + 1, nl, (nl + nr) / 2, ql, qr, dat),
                                 update(2 * k + 2, (nl + nr) / 2, nr, ql, qr, dat));
            return seg[k];
        }
    }

    // [l, r) <= dat
    void update(int l, int r, Laz dat) {
        update(0, 0, size, l, r, dat);
    }

    Monoid query(int k, int nl, int nr, int ql, int qr) {

        propagation(k, nr - nl);
        
        if (nr <= ql || qr <= nl) return e;

        if (ql <= nl && nr <= qr) return seg[k];
        else return mergeMonoid(query(2 * k + 1, nl, (nl + nr) / 2, ql, qr),
                                query(2 * k + 2, (nl + nr) / 2, nr, ql, qr));
    }

    // [l, r)
    Monoid query(int l, int r) { return query(0, 0, size, l, r); }

    Monoid operator [](const int &k) { return query(k, k + 1); }
};
//===

LazySegmentTree<ll, ll> seg(600005, 1ll << 40ll,
                            [](ll l, ll r) { return min(l, r); },
                            [](ll l, ll r, int len) { return min(l, r); },
                            [](ll l, ll r) { return min(l, r); } );

ll n, q;
ll s[200005], t[200005], x[200005];
ll d[200005];

map<ll, ll> zip;
vector<ll> raw;

void compress() {
    sort(raw.begin(), raw.end());
    raw.erase(unique(raw.begin(), raw.end()), raw.end());

    ll i = 0;
    for (auto s:raw) {
        zip[s] = i;
        i++;
    }
}

int main() {
    cin >> n >> q;
    for (int i = 0; i < n; i++) {
        cin >> s[i] >> t[i] >> x[i];
        
        raw.push_back(s[i] - x[i]);
        raw.push_back(t[i] - x[i]);
    }
    for (int i = 0; i < q; i++) {
        cin >> d[i];
        raw.push_back(d[i]);
    }

    compress();

    for (int i = 0; i < n; i++) {
        ll l = zip[s[i] - x[i]];
        ll r = zip[t[i] - x[i]];

        seg.update(l, r, x[i]);
    }

    for (int i = 0; i < q; i++) {
        ll a = seg[zip[d[i]]];

        if (a == 1ll << 40ll) {
            cout << -1 << endl;
        }
        else {
            cout << a << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 85096