#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1'000'000'007;
template <class T> bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0; }
template <class T> bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0; }

// const int INF = INT_MAX;
struct LazySegmentTree {
  private:
    ll n;
    vector<ll> node, lazy;
    vector<bool> lazyFlag;

  public:
    LazySegmentTree(ll sz) {
        // int sz = n//(int)v.size();
        n = 1LL;
        while (n < sz)
            n *= 2LL;
        node.resize(2LL * n - 1LL, INF);
        lazy.resize(2LL * n - 1LL, INF);
        lazyFlag.resize(2LL * n - 1LL, false);

        // for (int i = 0; i < sz; i++)
        //     node[i + n - 1] = v[i];
        // for (int 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 > 1LL) {
                lazy[k * 2LL + 1LL] = lazy[k * 2LL + 2LL] = lazy[k];
                lazyFlag[k * 2LL + 1LL] = lazyFlag[k * 2LL + 2LL] = true;
            }
            lazyFlag[k] = false;
        }
    }

    void update(ll a, ll b, ll x, ll k = 0LL, ll l = 0LL, ll r = -1LL) {
        if (r < 0LL)
            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, 2LL * k + 1LL, l, (l + r) / 2LL);
            update(a, b, x, 2LL * k + 2LL, (l + r) / 2LL, r);
            node[k] = min(node[2LL * k + 1LL], node[2LL * k + 2LL]);
        }
    }

    ll find(ll a, ll b, ll k = 0LL, ll l = 0LL, ll r = -1LL) {
        if (r < 0LL)
            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, 2LL * k + 1LL, l, (l + r) / 2LL);
        ll vr = find(a, b, 2LL * k + 2LL, (l + r) / 2LL, r);
        return min(vl, vr);
    }
};

int main() {
    ll n, q;
    cin >> n >> q;
    vector<pair<ll, pair<ll, ll>>> xst(n);
    for (ll i = 0; i < n; ++i) {
        cin >> xst[i].second.first >> xst[i].second.second >> xst[i].first;
    }
    sort(xst.begin(), xst.end(), greater<pair<ll, pair<ll, ll>>>());
    vl d(q);
    for (ll i = 0; i < q; ++i) {
        cin >> d[i];
    }
    LazySegmentTree st(q + 1);
    // for(auto it = xst.begin(); it != xst.end(); ++it) {
    for (auto xx : xst) {
        ll left = lower_bound(d.begin(), d.end(), xx.second.first - xx.first) - d.begin();
        ll right =
            lower_bound(d.begin(), d.end(), xx.second.second - xx.first) - d.begin();
        st.update(left, right, xx.first);
    }
    for (ll i = 0; i < q; ++i) {
        ll ret = st.find(i, i + 1LL);
        if (ret == INF)
            cout << -1 << endl;
        else
            cout << ret << endl;
    }
    return 0;
}

Measured memory_bytes: 16384