#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 = 1000000007;
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;
}

// 0-indexed Lazy segment tree for range minimum query
// TODO: understand algebra in the lazy update and
// update this as a template for generic function (monoid)

// cut begin ----------------------------------------

template <typename T = ll>
struct SegmentTreeLazy {
  private:
    using F = function<T(T, T)>;
    int n;
    vector<T> node, lazy;
    vector<bool> lazyFlag;
    F func;
    T UNIT;

  public:
    SegmentTreeLazy(int sz, F func, T UNIT) : func(func), UNIT(UNIT) {
        n = 1;
        while (n < sz)
            n *= 2;
        node.assign(2 * n - 1, UNIT);
        lazy.assign(2 * n - 1, UNIT);
        lazyFlag.resize(2 * n - 1, false);
    }
    SegmentTreeLazy(vector<T> v, F func, T UNIT) : func(func), UNIT(UNIT) {
        int sz = int(v.size());
        n = 1;
        while (n < sz)
            n *= 2;
        node.resize(2 * n - 1, UNIT);
        lazy.resize(2 * n - 1, UNIT);
        lazyFlag.resize(2 * n - 1, false);

        for (int i = 0; i < sz; i++)
            node[i + n - 1] = v[i];
        for (int i = n - 2; i >= 0; i--)
            node[i] = func(node[i * 2 + 1], node[i * 2 + 2]);
    }
    void lazyEvaluate(int k, int l, int 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;
        }
    }
    // replace nodes with x in [a, b)
    void update(int a, int b, T x, int k = 0, int l = 0, int 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 {
            const int mid = (l + r) / 2;
            update(a, b, x, 2 * k + 1, l, mid);
            update(a, b, x, 2 * k + 2, mid, r);
            node[k] = func(node[2 * k + 1], node[2 * k + 2]);
        }
    }
    // add x to nodes in [a, b)
    void add(int a, int b, T x, int k = 0, int l = 0, int r = -1) {
        if (r < 0)
            r = n;
        lazyEvaluate(k);
        if (b <= l || r <= a) {
            return;
        }
        if (a <= l && r <= b) {
            lazy[k] += x; // +=
            lazyFlag[k] = true;
            lazyEvaluate(k);
            return;
        } else {
            const int mid = (l + r) / 2;
            add(a, b, x, k * 2 + 1, l, mid);
            add(a, b, x, k * 2 + 2, mid, r);
            node[k] = func(node[2 * k + 1], node[2 * k + 2]);
        }
    }
    // get func() in [a, b)
    T query(int a, int b, int k = 0, int l = 0, int 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];
        T vl = query(a, b, 2 * k + 1, l, (l + r) / 2);
        T vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
        return func(vl, vr);
    }
};

// cut end ------------------------------------------

// https://atcoder.jp/contests/abc128/submissions/5658290
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    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];
    }
    auto f = [](ll a, ll b) { return min(a, b); };
    SegmentTreeLazy<> st(q + 1, f, INF);
    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.query(i, i + 1LL);
        if (ret == INF)
            cout << -1 << "\n";
        else
            cout << ret << "\n";
    }
    return 0;
}

Measured memory_bytes: 16384