#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
const ll MOD = (ll) (1e9 + 7);
const double PI = acos(-1.0);

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a % b);
}

inline ll CEIL(ll a, ll b) {
    return (a + b - 1) / b;
}

//------------------------------------------------------

const ll sqrtN = 512;

struct SqrtDecomposition {
    ll N, K;
    vector<ll> data;
    vector<bool> lazyFlag;
    vector<ll> lazyUpdate;

    SqrtDecomposition(ll n) : N(n) {
        K = (N + sqrtN - 1) / sqrtN;
        data.assign(K * sqrtN, INF);
        lazyFlag.assign(K, false);
        lazyUpdate.assign(K, 0);
    }

    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) {
                lazyFlag[k] = true;
                lazyUpdate[k] = x;
            } else {
                eval(k);
                for (ll i = max(s, l); i < min(t, r); ++i) {
                    data[i] = x;
                }
            }
        }
    }

    ll find(ll i) {
        ll k = i / sqrtN;
        eval(k);
        return data[i];
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, q;
    scanf("%lld %lld", &n, &q);
    vector<pair<ll, pll> > kouzi(n); //(x, (s, t))
    vector<pair<ll, pll> > person(q + 1); //secondは(sort前の番号,sort後の番号)

    rep(i, n) {
        scanf("%lld %lld %lld", &kouzi[i].second.first, &kouzi[i].second.second, &kouzi[i].first);
    }

    rep(i, q) {
        scanf("%lld", &person[i].first);
        person[i].second.first = i;
        person[i].second.second = 0;
    }
    person[q] = MP(LINF, MP(LINF, q));
    sort(all(kouzi));
    reverse(all(kouzi));
    sort(all(person));
    rep(i, q) person[i].second.second = i;


    SqrtDecomposition sd(200010);
    sd.update(0, 200010, -1);

    rep(i, n) {
        ll s = kouzi[i].second.first;
        ll t = kouzi[i].second.second;
        ll x = kouzi[i].first;
        auto itr1 = lower_bound(all(person), MP(s - x, MP(-LINF, -LINF)));
        auto itr2 = upper_bound(all(person), MP(t - x - 1, MP(LINF, LINF)));
        ll l = (*itr1).second.second, r = (*itr2).second.second;
        sd.update(l, r, x);
    }
    ll ans[200010];
    rep(i, q) ans[person[i].second.first] = sd.find(person[i].second.second);
    rep(i, q) printf("%lld\n", ans[i]);
    return 0;
}


Measured memory_bytes: 14464