#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define BUGAVOID(x) x
#define rep(...) BUGAVOID(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll;
typedef vector<int> vi; typedef vector<ll> vll; template<class T>using vv = vector<vector<T>>;
template<class T>vv<T> vvec(size_t n, size_t m, T v) { return vv<T>(n, vector<T>(m, v)); }
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; }
constexpr int INF = 1 << 28, MOD = int(1e9) + 7; constexpr ll LINF = 1ll << 60; constexpr double EPS = 1e-6;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); }; }aaaa;

template<typename T = ll, typename E = ll>
struct LEST_Operator_RM_RU {
    static constexpr T I_T = std::numeric_limits<T>::max();
    static constexpr E I_E = E(0);
    template<typename T_L = T, typename T_R = T> constexpr T f(T_L && lhs, T_R && rhs) const {
        static_assert(std::is_same<std::remove_reference_t<T_L>, T>::value, "");
        static_assert(std::is_same<std::remove_reference_t<T_R>, T>::value, "");
        return min<T>(lhs, rhs);
    }
    constexpr T g(T& lhs, E& rhs) const { return T(rhs); }
    constexpr E h(E& lhs, E& rhs) const { return rhs; }
};
template<typename T, typename E> constexpr T LEST_Operator_RM_RU<T, E>::I_T;
template<typename T, typename E> constexpr E LEST_Operator_RM_RU<T, E>::I_E;
template<typename T, typename E, class F>
struct LazyEvaluationSegmentTree {
    const F op = F();
    int n, height;
    vector<T> dat;
    vector<E> laz;
    void init(int n_) {
        n = 1; height = 0;
        while (n < n_) n *= 2, height++;
        dat.assign(2 * n, op.I_T);
        laz.assign(2 * n, op.I_E);
    }
    void build(const vector<T>& v) {
        int n_ = v.size();
        init(n_);
        for (int i = 0; i < n_; i++) dat[n + i] = v[i];
        for (int i = n - 1; i; i--) dat[i] = op.f(dat[i << 1], dat[(i << 1) + 1]);
    }
    T reflect(int k) {
        return laz[k] == op.I_E ? dat[k] : op.g(dat[k], laz[k]);
    }
    void eval(int k) {
        if (laz[k] == op.I_E) return;
        laz[(k << 1) | 0] = op.h(laz[k << 1], laz[k]);
        laz[(k << 1) | 1] = op.h(laz[(k << 1) + 1], laz[k]);
        dat[k] = reflect(k);
        laz[k] = op.I_E;
    }
    void thrust(int k) {
        for (int i = height; i; i--) eval(k >> i);
    }
    void recalc(int k) {
        while (k >>= 1) dat[k] = op.f(reflect(k << 1), reflect((k << 1) + 1));
    }
    void update(int a, int b, E x) {
        thrust(a += n); thrust(b += n - 1);
        for (int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
            if (l & 1) laz[l] = op.h(laz[l], x), l++;
            if (r & 1) --r, laz[r] = op.h(laz[r], x);
        }
        recalc(a); recalc(b);
    }
    void set_val(int a, T x) {
        thrust(a += n);
        dat[a] = x;
        laz[a] = op.I_E;
        recalc(a);
    }
    T query(int a, int b) {
        thrust(a += n); thrust(b += n - 1);
        T vl = op.I_T, vr = op.I_T;
        for (int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
            if (l & 1) vl = op.f(vl, reflect(l++));
            if (r & 1) vr = op.f(reflect(--r), vr);
        }
        return op.f(vl, vr);
    }
};

int N, Q;
vi S, T, X, D;
LazyEvaluationSegmentTree<int, int, LEST_Operator_RM_RU<int, int>> lest;

int main() {
    cin >> N >> Q;
    S.resize(N);
    T.resize(N);
    X.resize(N);
    D.resize(Q);
    rep(i, N) cin >> S[i] >> T[i] >> X[i];
    rep(i, Q) cin >> D[i];

    vector<pair<int, pair<int, int>>> ST_x0;
    ST_x0.reserve(N);
    vi time_cmp;
    rep(i, N) {
        ST_x0.emplace_back(X[i], mp(S[i] - X[i], T[i] - X[i]));
        time_cmp.push_back(S[i] - X[i]);
        time_cmp.push_back(T[i] - X[i]);
    }
    sort(all(ST_x0), greater<pair<int, pair<int, int>>>());
    rep(i, Q) {
        time_cmp.push_back(D[i]);
    }
    sort(all(time_cmp));
    time_cmp.erase(unique(all(time_cmp)), time_cmp.end());

    vi _v(time_cmp.size(), LEST_Operator_RM_RU<int, int>::I_T);
    lest.build(_v);

    rep(i, N) {
        int s = ST_x0[i].second.first;
        int t = ST_x0[i].second.second;
        int si = lower_bound(all(time_cmp), s) - time_cmp.begin();
        int ti = lower_bound(all(time_cmp), t) - time_cmp.begin();
        lest.update(si, ti, ST_x0[i].first);
    }

    rep(i, Q) {
        int qi = lower_bound(all(time_cmp), D[i]) - time_cmp.begin();
        int d = lest.query(qi, qi + 1);

        if (d == LEST_Operator_RM_RU<int, int>::I_T) {
            write(-1);
        }
        else {
            write(d);
        }
    }
}

Measured memory_bytes: 28908