#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
struct edge{ll to,cost;};
const int inf = 1<<27;
const ll INF = 1LL<<60;
const int COMBMAX = 1001001;
const ll MOD = 1000000007; //998244353
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define eachdo(v, e) for(const auto& e : (v))
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (ll)distance((v).begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (ll)distance((v).begin(), upper_bound((v).begin(), (v).end(), e))
ll mpow(ll a, ll n, ll mod = MOD){ll res = 1; while(n > 0){if(n & 1)res = res * a % mod; a = a * a % mod; n >>= 1;} return res;}
void YesNo(bool j){cout << (j ? "Yes" : "No") << endl; return;}
void yesno(bool j){cout << (j ? "yes" : "no") << endl; return;}
template<class T1, class T2> ll bcount(T1 v, T2 a){return upper_index(v, a) - lower_index(v, a);} 
template<class T> inline bool chmin(T &a, T b){if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){if(a < b){a = b; return true;} return false;}
template<class T> void debug(T v){rep(i, v.size()) cout << v[i] << " " ; cout << endl;}
template<class T> void debug2(T v){rep(i, v.size()){rep(j, v[i].size()) cout << v[i][j] << " " ; cout << endl;}}

struct LazySegmentTree {
private:
    int n;
    vector<ll> node, lazy;
    vector<bool> lazyFlag;

public:
    LazySegmentTree(vector<ll> v) {
        int sz = (int)v.size();
        n = 1; while(n < sz) n *= 2;
        node.resize(2*n-1);
        lazy.resize(2*n-1, INF);
        lazyFlag.resize(2*n-1, false);

        for(int i=0; i<sz; i++) node[i+n-1] = v[i];
        for(int i=n-2; i>=0; i--) node[i] = min(node[i*2+1], node[i*2+2]);
    }

    void lazyEvaluate(int k, int l, int r) {
        if(lazyFlag[k]) {
            node[k] = lazy[k];
            if(r - l > 1) {
                lazy[k*2+1] = lazy[k*2+2] = lazy[k];
                lazyFlag[k*2+1] = lazyFlag[k*2+2] = true;
            }
            lazyFlag[k] = false;
        }
    }

    void update(int a, int b, ll x, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        lazyEvaluate(k, l, r);
        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[k] = x;
            lazyFlag[k] = true;
            lazyEvaluate(k, l, r);
        }
        else {
            update(a, b, x, 2*k+1, l, (l+r)/2);
            update(a, b, x, 2*k+2, (l+r)/2, r);
            node[k] = min(node[2*k+1], node[2*k+2]);
        }
    }

    ll query(int a, int b, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        lazyEvaluate(k, l, r);
        if(b <= l || r <= a) return INF;
        if(a <= l && r <= b) return node[k];
        ll vl = query(a, b, 2*k+1, l, (l+r)/2);
        ll vr = query(a, b, 2*k+2, (l+r)/2, r);
        return min(vl, vr);
    }
    ll at(int l){
        return query(l, l + 1, 0, 0, -1);
    }
};

template<class T1, class T2> void sortTwoVecter(vector<T1> &f, vector<T2> &s){
    vector<pair<T1, T2>> p;
    rep(i, f.size()) p.emplace_back(make_pair(f[i], s[i]));
    sort(all(p));
    rep(i, f.size()) tie(f[i], s[i]) = p[i];
    return;
}

int main(){
    ll N, Q; cin >> N >> Q;
    vector<ll> S(N), T(N), X(N), xid(N), d(N);

    rep(i, N){
        cin >> S[i] >> T[i] >> X[i];
        xid[i] = X[i];
        d[i] = i;
    }
    sortTwoVecter(xid, d);
    reverse(all(d));
    reverse(all(xid));
    vector<ll> point;
    point.emplace_back(0);
    rep(i, N){
        if (0 <= S[i] - X[i]) point.emplace_back(S[i] - X[i]);
        if (0 <= T[i] - X[i]) point.emplace_back(T[i] - X[i]);
    }
    sort(all(point));
    decltype(point)::iterator result = unique(all(point));
    point.erase(result, point.end());
    point.emplace_back(point[point.size() - 1] + 1);
    ll sz = point.size();

    LazySegmentTree st(vector<ll>(sz, -1));
    rep(f, N){
        int i = d[f];
        if (T[i] - X[i] <= 0) continue;
        int l;
        if (S[i] - X[i] < 0) l = 0;
        else l = lower_index(point, S[i] - X[i]);
        int r = lower_index(point, T[i] - X[i]);
        st.update(l, r, X[i]);
    }
    rep(i, Q){
        ll x; cin >> x;
        cout << st.at(upper_index(point, x) - 1) << endl;
    }
    return 0;
}


Measured memory_bytes: 33844