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

template <class Monoid, class Operator, class Apply>
struct LazySegTree {
    using T = typename Monoid::type;
    Monoid M;
    using U = typename Operator::type;
    Operator Op;
    Apply apply;
    int n;
    vector<T> v;
    vector<U> f;

    LazySegTree(
        int n_,
        const Monoid &m = Monoid(),
        const Operator &op = Operator(),
        const Apply &ap = Apply()) 
    : M(m), Op(op), apply(ap) 
    {
        n = 1;
        while (n < n_) n *= 2;
        v.assign(n * 2, M.id());
        f.assign(n * 2, Op.id());
    }

    LazySegTree(
        int n_,
        const vector<T> &init,
        const Monoid &m = Monoid(),
        const Operator &op = Operator(),
        const Apply &ap = Apply())
    : LazySegTree(n_, m, op, ap) 
    {
        copy(init.begin(), init.end(), v.begin() + n);
        for (int k = n-1; k > 0; k--) {
            v[k] = M.append(v[2*k+0], v[2*k+1]);
        }
    }

    void propagate(int k, int l, int r) {
        range_apply(0, n, 2*k+0, l, (l+r)/2, f[k]);
        range_apply(0, n, 2*k+1, (l+r)/2, r, f[k]);
        f[k] = Op.id();
    }

    void point_set(int i, T a) {
        point_set(i, 1, 0, n, a);
    }
    void point_set(int i, int k, int l, int r, T a) {
        if (k == n + i) {
            v[k] = a;
        } else if (r <= i || i < l) {
            return;
        } else {
            propagate(k, l, r);
            point_set(i, 2*k+0, l, (l+r)/2, a);
            point_set(i, 2*k+1, (l+r)/2, r, a);
            v[k] = M.append(v[2*k+0], v[2*k+1]);
        }
    }
    void range_apply(int a, int b, U z) {
        range_apply(a, b, 1, 0, n, z);
    }
    void range_apply(int a, int b, int k, int l, int r, U z) {
        if (a <= l && r <= b) {
            v[k] = apply(v[k], z, l, r);
            f[k] = Op.append(f[k], z);
        } else if (r <= a || b <= l) {
            return;
        } else {
            propagate(k, l, r);
            range_apply(a, b, k*2+0, l, (l+r)/2, z);
            range_apply(a, b, k*2+1, (l+r)/2, r, z);
            v[k] = M.append(v[k*2+0], v[k*2+1]);
        }
    }
    T range_concat(int a, int b) {
        return range_concat(a, b, 1, 0, n);
    }
    T range_concat(int a, int b, int k, int l, int r) {
        if (a <= l && r <= b) return v[k];
        if (r <= a || b <= l) return M.id();
        propagate(k, l, r);
        T vl = range_concat(a, b, k*2+0, l, (l + r) / 2);
        T vr = range_concat(a, b, k*2+1, (l + r) / 2, r);
        return M.append(vl, vr);
    }
};

struct minmn {
    using type = ll;
    type id() {return (1LL << 31) - 1;}
    type append(type a, type b) {return min(a, b);}
};

struct apply {
    int operator ()(int v, int o, int l, int r) {
        return min(v, o);
    }
};

int main() {
    int n, q;
    cin >> n >> q;
    struct S {
        int s, t, x;
    };
    vector<S> a(n);
    vector<int> dict(2*n+1);

    for (int i = 0; i < n; i++) {
        cin >> a[i].s >> a[i].t >> a[i].x;
        a[i].s = max(a[i].s-a[i].x, 0);
        a[i].t = max(a[i].t-a[i].x, 0);
        dict[i*2] = a[i].s;
        dict[i*2+1] = a[i].t;
    }
    dict[n*2] = 0;
    
    sort(dict.begin(), dict.end());
    dict.erase(unique(dict.begin(), dict.end()), dict.end());
    
    int m = dict.size();
    auto zip = [&](int v) {
        return upper_bound(dict.begin(), dict.end(), v) - dict.begin() - 1;
    };
    
    LazySegTree<minmn, minmn, apply> st(m);
    for (auto &e: a) {
        st.range_apply(zip(e.s), zip(e.t), e.x);
    }
    
    while (q--) {
        int d;
        cin >> d;
        int zd = zip(d);
        int r = st.range_concat(zd, zd+1);
        if (r == minmn().id()) {
            cout << -1 << endl;
        } else {
            cout << r << endl;
        }
    }
    
    return 0;
}


Measured memory_bytes: 22528