#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define ALL(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

///// For Debug

#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
// vector
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream &operator<<(ostream &os, map<T, U> &map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream &operator<<(ostream &os, set<T> &set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}

// 提出時はコメントアウト
// #define LOCAL
#define DEBUG_

#ifndef LOCAL
#undef DEBUG_
#endif

#ifdef DEBUG_

#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)

#endif

//////////




ll zarts(const vector<ll> &X, ll x) {
    return lower_bound(ALL(X), x) - X.begin();
}

int main(){
    #ifdef LOCAL
    ifstream in("../Atcoder/input.txt");
    cin.rdbuf(in.rdbuf());
    #endif

    ll N,Q;
    cin >> N >> Q;

    vector<ll> S(N),T(N),X(N),D(Q);
    rep(i,N) 
        cin >> S[i] >> T[i] >> X[i];
    rep(i,Q)
        cin >> D[i];


    map<ll,vector<ll>> L,R;
    rep(i,N) {    
        ll l = S[i] - X[i];
        ll r = T[i] - X[i];

        ll pos_l = zarts(D,l);
        ll pos_r = zarts(D,r);

        if (pos_l == pos_r) continue;
        L[pos_l].push_back(X[i]);
        R[pos_r].push_back(X[i]);
    } 
    
    #ifdef DEBUG_
    cout << "----" << endl;
    #endif
    
    set<ll> worked;
    rep(d,Q) {
        vector<ll> ls = L[d];
        vector<ll> rs = R[d];

        // sort(ALL(ls));
        // sort(ALL(rs));

        for (const auto &r : rs) {
            worked.erase(r);
        }

        for (const auto &l : ls) {
            worked.insert(l);
        }

        // dump(worked);

        ll x;
        if (worked.empty())
            x = -1;
        else 
            x = *worked.begin(); // min

        
        cout << x << endl;
    }
}

Measured memory_bytes: 48528