#include <bits/stdc++.h>

using namespace std;

#define int long long
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"
#define Printv(v)                                                              \
    {                                                                          \
        FOREACH(x, v) { cout << x << " "; }                                    \
        cout << "\n";                                                          \
    }

typedef long long ll;
typedef unsigned long long ul;
typedef vector<ll> VL;
typedef pair<ll, ll> PL;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll, VL, greater<ll>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18;
const ll dx[] = {1, -1, 0, 0};
const ll dy[] = {0, 0, 1, -1};

int N, Q;

template <typename T> struct SegTree {
    vector<T> dat;
    ll size;

    SegTree(ll n) { init(n); };

    void init(ll n_) {
        size = 1;
        while(size < n_) size *= 2;
        dat.resize(2 * size - 1);
        REP(i, 2 * size - 1) dat[i] = LINF;
    };

    T getval(ll k) {
        k += size - 1;
        ll ret = dat[k];
        while(k > 0) {
            k = (k - 1) / 2;
            ret = min(ret, dat[k]);
        }
        return ret;
    }

    void update2(ll x, ll y, T v, ll l, ll r, ll k) {
        if(l >= r) return;
        if(x <= l && r <= y)
            dat[k] = min(dat[k], v);
        else if(l < y && x < r) {
            update2(x, y, v, l, (l + r) / 2, k * 2 + 1);
            update2(x, y, v, (l + r) / 2, r, k * 2 + 2);
        }
    }

    void update1(ll k, ll a) {
        k += size - 1;
        dat[k] = a;
        while(k > 0) {
            k = (k - 1) / 2;
            dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
        }
    };

    ll query(ll a, ll b, ll k, ll l, ll r) {
        if(r <= a || b <= l) return LINF;
        if(a <= l && r <= b)
            return dat[k];
        else {
            ll vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
            ll vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
            return min(vl, vr);
        }
    };
};

ll x, y;
SegTree<ll> seg(1 << 20);
VL cmp;
VL S(200000), T(200000), X(200000), D(200000);

signed main() {
    cin >> N >> Q;
    REP(i, N) {
        cin >> S[i] >> T[i] >> X[i];
        cmp.emplace_back(S[i] - X[i]);
        cmp.emplace_back(T[i] - X[i]);
    }
    REP(i, Q) {
        cin >> D[i];
        cmp.emplace_back(D[i]);
    }
    sort(All(cmp));
    cmp.erase(unique(All(cmp)), cmp.end());
    REP(i, N) {
        x = lower_bound(All(cmp), S[i] - X[i]) - cmp.begin();
        y = lower_bound(All(cmp), T[i] - X[i]) - cmp.begin();
        seg.update2(x, y, X[i], 0, seg.size, 0);
    }
    REP(i, Q) {
        x = lower_bound(All(cmp), D[i]) - cmp.begin();
        ll ret = seg.getval(x);
        cout << (ret < LINF ? ret : -1) << "\n";
    }
    return 0;
}

Measured memory_bytes: 32876