#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> P3;
typedef pair<P ,P> PP;
const ll MOD = ll(1e9)+7;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(1e5 + 5);
const double EPS = 1e-6;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define ALL(v) (v).begin(), (v).end()

struct SqrtDecomposition {
    const ll sqrtN = 600;
    const ll INF = LONG_LONG_MAX;
    ll N, K;
    vector<ll> data;
    vector<ll> bucketSum;
    vector<bool> lazyFlag;
    vector<ll> lazyUpdate;
    SqrtDecomposition(ll n = 0LL, ll x = 0LL) : N(n) {
        K = (N + sqrtN - 1) / sqrtN;
        data.assign(K*sqrtN, x);
        //bucketSum.assign(K, x*sqrtN);
        lazyFlag.assign(K, false);
        lazyUpdate.assign(K, x);
    }
    void init(ll n, ll x = 0LL){
        N = n;
        K = (N + sqrtN - 1) / sqrtN;
        data.assign(K*sqrtN, x);
        //bucketSum.assign(K, x*sqrtN);
        lazyFlag.assign(K, false);
        lazyUpdate.assign(K, x);
    }
    void eval(ll k) {
        if (lazyFlag[k]) {
            lazyFlag[k] = false;
            for (ll i = k * sqrtN; i < (k + 1) * sqrtN; ++i) {
                data[i] = lazyUpdate[k];
            }
        }
    }
    // [s, t)
    void update(ll s, ll t, ll x) {
        for (ll k = 0; k < K; ++k) {
            ll l = k * sqrtN, r = (k + 1) * sqrtN;
            if (r <= s || t <= l) continue;
            if (s <= l && r <= t) {
                //bucketSum[k] = x * sqrtN;
                lazyFlag[k] = true;
                lazyUpdate[k] = x;
            } else {
                eval(k);
                for (ll i = l; i < r; ++i) {
                    data[i] = data[i];
                }
                for (ll i = max(s, l); i < min(t, r); ++i) {
                    data[i] = x;
                }
                /*
                ll &sumVal = bucketSum[k] = 0ll;
                for (ll i = l; i < r; ++i) {
                    sumVal = sumVal + data[i];
                }
                */
            }
        }
    }
    // [s, t)
    ll getSum(ll s, ll t) {
        ll sumVal = 0;
        for (ll k = 0; k < K; ++k) {
            ll l = k * sqrtN, r = (k + 1) * sqrtN;
            if (r <= s || t <= l) continue;
            if (s <= l && r <= t) {
                //sumVal = sumVal + bucketSum[k];
            } else {
                eval(k);
                for (ll i = max(s, l); i < min(t, r); ++i) {
                    sumVal = sumVal + data[i];
                }
            }
        }
        return sumVal;
    }
    ll get(ll s){
        ll k = s/sqrtN;
        eval(k);
        return data[s];
    }
    // [s, t)
};

void compress(vector<ll> &x, map<ll, ll> &zip) {
    sort(x.begin(), x.end());
    x.erase(unique(x.begin(), x.end()), x.end());
    for (int i = 0; i < x.size(); i++) {
        zip[x[i]] = i;
    }
}

int main() {
    ll N, Q;
    vector<P3> v;
    vector<ll> xs, query;
    map<ll,ll> mp;
    cin >> N >> Q;
    REP(i,N){
        ll s, t, x;
        //cin >> s >> t >> x;
        scanf("%lld %lld %lld", &s, &t, &x);
        if(t-x < 0) continue;
        v.push_back({x,{s-x,t-x}});
        xs.push_back(s-x);
        xs.push_back(t-x);
    }
    query.resize(Q);
    REP(i,Q){
        cin >> query[i];
        xs.push_back(query[i]);
    }
    compress(xs,mp);
    SORTR(v);
    SqrtDecomposition ruq;
    ruq.init(int(xs.size()),-1);
    REP(i,int(v.size())){
        ll s = v[i].second.first, t = v[i].second.second;
        ruq.update(mp[s],mp[t],v[i].first);
    }
    REP(i,Q){
        ll d = mp[query[i]];
        cout << ruq.get(d) << endl;
    }
    return 0;
}


Measured memory_bytes: 54424