#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#ifdef _DEBUG_
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl
#else
#define dump(val)
#endif

using namespace std;

typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}
template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

const int INF = 1 << 30;
struct LazySegmentTree {
private:
    int n;
    vector<int> node, lazy;
    vector<bool> lazyFlag;

public:
    LazySegmentTree(vector<int> v) {
        int sz = (int)v.size();
        n = 1;
        while (n < sz) n *= 2;
        node.resize(2 * n - 1);
        lazy.resize(2 * n - 1, INF);
        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] = min(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;
        }
    }

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

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

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, q;
    cin >> n >> q;
    vector<int> S(n), T(n), X(n);
    vector<int> D(q);

    int sz = 0;
    {
        vector<int> compress;
        compress.push_back(-1);
        REP(i, 0, n) {
            int s, t, x;
            cin >> s >> t >> x;
            s = max(0, s - x);
            t = max(0, t - x);
            S[i] = s;
            T[i] = t;
            X[i] = x;
            compress.push_back(s);
            compress.push_back(t);
        }
        REP(i, 0, q) {
            cin >> D[i];
            compress.push_back(D[i]);
        }
        sort(compress.begin(), compress.end());
        compress.erase(unique(compress.begin(), compress.end()), compress.end());
        REP(i, 0, n) {
            S[i] = lower_bound(compress.begin(), compress.end(), S[i]) - compress.begin();
            T[i] = lower_bound(compress.begin(), compress.end(), T[i]) - compress.begin();
        }
        REP(i, 0, q) {
            D[i] = lower_bound(compress.begin(), compress.end(), D[i]) - compress.begin();
        }
        sz = compress.size();
    }
    vector<int> ind(n); 
    iota(ind.begin(), ind.end(), 0);
    sort(ind.begin(), ind.end(), [&](int a, int b) {
        return X[a] > X[b];
    });

    vector<int> v(sz, INF);
    LazySegmentTree seg(v);
    REP(i, 0, n) {
        seg.update(S[ind[i]], T[ind[i]], X[ind[i]]);
    }
    REP (i, 0, q) {
        dump(D[i]);
        int res = seg.find(D[i], D[i] + 1);
        if (res == INF) {
            cout << -1 << endl;
        } else {
            cout << res << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 26564