#include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define FOR(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
using namespace std;

template <typename T> map<T, int> coordinate_compression(vector<T> x) {
    sort(x.begin(), x.end());
    x.erase(unique(x.begin(), x.end()), x.end());
    int n = x.size();
    vector<int> y(n);
    iota(y.begin(), y.end(), 0);
    sort(y.begin(), y.end(), [&](int i, int j) { return x[i] < x[j]; });
    map<T, int> res;
    for (int i : y) if (!res.count(x[i])) {
        int j = res.size();
        res[x[i]] = j;
    }
    return res;
}

// Dual Segment Tree
template <class OM = int> struct DST {
    int n, lev;
    vector<OM> lz;
    virtual OM h(OM, OM) = 0;
    const OM e0;

    DST(int n_, const OM& e0) : e0(e0) {
        for (n = 1, lev = 0; n < n_; n <<= 1, ++lev);
        lz.assign(n << 1, e0);
    }

    inline void push(int k) {
        for (int i = lev; i > 0; --i) {
            int j = k >> i;
            if (lz[j] == e0) continue;
            lz[(j << 1) | 0] = h(lz[(j << 1) | 0], lz[j]);
            lz[(j << 1) | 1] = h(lz[(j << 1) | 1], lz[j]);
            lz[j] = e0;
        }
    }

    // [l, r)
    // l, r: 0-indexed
    void update(int l, int r, const OM& x) {
        push(l += n);
        push(r += n - 1);
        for (++r; l < r; l >>= 1, r >>= 1) {
            if (l & 1) lz[l] = h(lz[l], x), l++;
            if (r & 1) --r, lz[r] = h(lz[r], x);
        }
    }

    // k: 0-indexed
    OM query(int k) {
        push(k += n);
        return lz[k];
    }

    void dump(int);
};

// Range Update Query (RUQ)
template <class OM> struct RUQ : DST<OM> {
    RUQ(int n, OM e0 = numeric_limits<OM>::max()) : DST<OM>(n, e0) {}
    OM h(OM a, OM b) override { return b; }
};

// Range Add Query (RAQ)
template <class OM> struct RAQ : DST<OM> {
    RAQ(int n, OM e0 = 0) : DST<OM>(n, e0) {}
    OM h(OM a, OM b) override { return a + b; }
};

// print for debug
template <class M> void DST<M>::dump(int time) {
    if (~time) cerr << "time = " << time << endl;
    for (int i = 1; i <= (1LL << lev); i <<= 1) {
        for (int j = 0; j < i; ++j) {
            cerr << "  " << lz[j + i];
        }
        cerr << endl;
    }
    cerr << endl;
}

int N, Q;
int S[200010], T[200010], X[200010], D[200010];

void _main() {
    cin >> N >> Q;
    vector<int> v;
    REP (i, N) {
        cin >> S[i] >> T[i] >> X[i];
        v.push_back(max(0LL, S[i] - X[i]));
        v.push_back(max(0LL, T[i] - X[i]));
    }
    REP (i, Q) {
        cin >> D[i];
        v.push_back(D[i]);
    }
    auto cc = coordinate_compression(v);
    vector<int> ord(N);
    iota(ord.begin(), ord.end(), 0);
    sort(ord.begin(), ord.end(), [&](int i, int j) {
        return X[i] > X[j];
    });
    RUQ<int> ruq(cc.size(), -1);
    REP (i, N) {
        int j = ord[i];
        ruq.update(cc[S[j] - X[j]], cc[T[j] - X[j]], j);
    }
    REP (i, Q) {
        int j = ruq.query(cc[D[i]]);
        if (j == -1) cout << -1 << endl;
        else cout << X[j] << endl;
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

Measured memory_bytes: 67784