#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <climits>
#include <map>
using namespace std;

// 双対セグメント木 (Dual Segment Tree)
// ref: https://kimiyuki.net/blog/2019/02/22/dual-segment-tree/
template <typename MonoidType, typename OperatorType, class SegFunc>
struct DualSegmentTree {
    int n;
    vector<MonoidType> bottom;
    vector<OperatorType> lazy;
    OperatorType E;

    inline void build(const vector<MonoidType> &v) {
        int m = v.size();
        n = 1; while(n < m) n *= 2;
        bottom = v; bottom.resize(n);
        lazy.resize(n - 1, E);
    }

    DualSegmentTree() {}
    DualSegmentTree(OperatorType E_, vector<MonoidType> v) : E(E_) {
        build(v);
    }

    void update(int a, int b, OperatorType x, int l, int r, int k) {
        if(b <= l or r <= a) return;
        if(a <= l and r <= b) {
            if(k < lazy.size())
                lazy[k] = SegFunc::lazy_update(lazy[k], x);
            else
                bottom[k-n+1] = SegFunc::update(bottom[k-n+1], x);
        }
        else {
            int mid = (l + r) >> 1;
            update(0, n, lazy[k], l, mid, 2*k+1);
            update(0, n, lazy[k], mid, r, 2*k+2);
            lazy[k] = E;
            update(a, b, x, l, mid, 2*k+1);
            update(a, b, x, mid, r, 2*k+2);
        }
    }

    void update(int a, int b, OperatorType x) {
        update(a, b, x, 0, n, 0);
    }

    MonoidType query(int k) {
        MonoidType res = bottom[k];
        for(k = (k+n)>>1; k>0; k>>=1) { // 1-indexed
            res = SegFunc::update(res, lazy[k-1]);
        }
        return res;
    }
};


void DSL_2_D() {
    using Pair = pair<int, int>;
    struct SegFunc {
        static Pair lazy_update(Pair a, Pair b) { return b.second ? b : a; }
        static int update(int x, Pair p) {
            if(p.second == 0) return x;
            return p.first;
        }
    };

    int N, Q; cin >> N >> Q;
    DualSegmentTree<int, Pair, SegFunc> seg(make_pair(0, 0), vector<int>(N, INT_MAX));

    int indexed = 0;
    for(int i=0; i<Q; i++) {
        int q; cin >> q;
        if(q == 0) {
            int s, t, x; cin >> s >> t >> x;
            s -= indexed, t -= indexed, t++;
            seg.update(s, t, make_pair(x, 1));
        }
        if(q == 1) {
            int x; cin >> x; x -= indexed;
            cout << seg.query(x) << endl;
        }
    }
}

void DSL_2_E() {
    struct SegFunc {
        static int update(int a, int b) { return a + b; }
        static int lazy_update(int a, int b) { return a + b; }
    };

    int N, Q; cin >> N >> Q;
    DualSegmentTree<int, int, SegFunc> seg(0, vector<int>(N, 0));
    
    int indexed = 1;
    for(int i=0; i<Q; i++) {
        int query_type; cin >> query_type;
        if(query_type == 0) {
            int s, t, x; cin >> s >> t >> x; t++;
            s -= indexed, t -= indexed;
            seg.update(s, t, x);
        }
        if(query_type == 1) {
            int s; cin >> s;
            s -= indexed;
            cout << seg.query(s) << endl;
        }
        // seg.dump();
    }    
}

void ABC128_E() {
    int N, Q; cin >> N >> Q;

    map<int, int> cmp; int id = 0;
    vector<int> s(N), t(N), x(N), p(Q);
    for(int i=0; i<N; i++) {
        cin >> s[i] >> t[i] >> x[i];
        s[i] = max(0, s[i] - x[i]);
        t[i] = max(0, t[i] - x[i]);
        cmp[ s[i] ]++; cmp[ t[i] ]++; cmp[ t[i] - 1 ]++;
    }
    for(int i=0; i<Q; i++) {
        cin >> p[i];
        cmp[ p[i] ]++;
    }
    for(auto &e : cmp) e.second = id++;
    for(int i=0; i<N; i++) {
        s[i] = cmp[ s[i] ], t[i] = cmp[ t[i] ];
    }
    for(int i=0; i<Q; i++) {
        p[i] = cmp[ p[i] ];
    }
    
    struct SegFunc {
        static int update(int a, int b) { return min(a, b); }
        static int lazy_update(int a, int b) { return min(a, b); }
    };
    DualSegmentTree<int, int, SegFunc> seg(INT_MAX, vector<int>(id, INT_MAX));
    
    for(int i=0; i<N; i++) {
        seg.update(s[i], t[i], x[i]);
    }
    for(int i=0; i<Q; i++) {
        int res = seg.query(p[i]);
        if(res == INT_MAX) cout << -1 << endl;
        else cout << res << endl;
    }
}

int main() {
    // DSL_2_D();
    // DSL_2_E();
    ABC128_E();
}


Measured memory_bytes: 53068