#include <bits/stdc++.h>

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {os << "["; for (const auto &v : vec) {os << v << ","; } os << "]"; return os;}
template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) {os << "(" << p.first << ", " << p.second << ")"; return os;}

const pii INF = {numeric_limits<int>::max(), numeric_limits<int>::max()};

struct LazySegmentTree {
private:
    int n;
    vector<pii> node, lazy;
    vector<bool> lazyFlag;
 
public:
    LazySegmentTree(vector<pii> 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, pii 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]);
        }
    }
 
    pii find(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];
        pii vl = find(a, b, 2*k+1, l, (l+r)/2);
        pii vr = find(a, b, 2*k+2, (l+r)/2, r);
        return min(vl, vr);
    }
};

struct Interval {
    pii I;
    int x;
};

void solve() {
    int N, Q;
    cin >> N >> Q;
    vector<Interval> I(N);

    map<int, int> mp;

    vector<int> ss;
    for (int i = 0; i < N; i++) {
        int s, t, x;
        cin >> s >> t >> x;
        s -= x;
        t -= x;
        I[i].I = {s, t};
        I[i].x = x;
        ss.push_back(s);
        ss.push_back(t);

        mp[s] = 0; mp[t] = 0;
    }

    sort(all(I), [](Interval a, Interval b){return a.x < b.x;});
    sort(all(ss));
    ss.erase(unique(all(ss)), ss.end());

    int num = 0;
    for(auto e : mp) {
        mp[e.first] = num;
        num++;
    }
    vector<pii> v;
    for (int i = 0; i < num + 1; i++) {
        v.push_back(INF);
    }

    LazySegmentTree seg(v);
    for (int i = N - 1; i >= 0; i--) {
        seg.update(mp[I[i].I.first], mp[I[i].I.second], {i, I[i].x});
        // for (int j = 0; j < num; j++) {
        //     cout << seg.find(j, j + 1).first << ":";
        // }
        // cout << endl;
    }

    // for (int i = 0; i < N; i++) {
    //     cout << I[i].I << endl;
    // }
    //cout << "---" << endl;
    //cout << ss << endl;
    for (int i = 0; i < Q; i++) {
        int d;
        cin >> d;
        //cout << "d:" << d << endl;
        int k = upper_bound(all(ss), d) - ss.begin() - 1;

        //cout << "k:" << k << endl;
        pii p = seg.find(k, k + 1);

        //cout << p << endl;

        if (p.second == numeric_limits<int>::max()) {
            cout << -1 << endl;
        } else {
            cout << p.second << endl;
        }
        //cout << X[p.first] << endl; 
    }


}

int main() {
    #ifdef LOCAL_ENV
    cin.exceptions(ios::failbit);
    #endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    
    solve();
}

Measured memory_bytes: 46444