#include<vector>
#include<algorithm>
#include<functional>

template<typename T>
class LazySegmentTree{
    int n;
    std::vector<T> node;
    std::vector<T> lazy;
    std::vector<int> length;
    int height;

    using F = std::function<T(T, T)>;
    using S = std::function<T(T, int)>;

    F f;
    F g;
    F h;
    S s;
    T id1;
    T id2;

    void evaluate(int k){
        if(lazy[k] == id2){
            return;
        }

        if(k < n){
            lazy[k << 1] = h(lazy[k << 1], lazy[k]);
            lazy[(k << 1) | 1] = h(lazy[(k << 1) | 1], lazy[k]);
        }

        node[k] = g(node[k], s(lazy[k], length[k]));
        lazy[k] = id2;

        return;
    }

    void evaluate(int l, int r){
        for(int i = height ; 0 < i ; --i){
            evaluate(l >> i);
            evaluate(r >> i);
        }

        return;
    }

    void update(int k){
        node[k] = f(g(node[k << 1], s(lazy[k << 1], length[k << 1])), g(node[(k << 1) | 1], s(lazy[(k << 1) | 1], length[(k << 1) | 1])));
        return;
    }

public:
    LazySegmentTree(int n_, F f_, F g_, F h_, T id1_, T id2_, S s_ = [](T x, int len){ return x; }){
        init(n_, f_, g_, h_, id1_, id2_, s_);
    }

    LazySegmentTree(const std::vector<T>& dat, F f_, F g_, F h_, T id1_, T id2_, S s_ = [](T x, int len){ return x; }){
        build(dat, f_, g_, h_, id1_, id2_, s_);
    }

    void init(int n_, F f_, F g_, F h_, T id1_, T id2_, S s_ = [](T x, int len){ return x; }){
        n = 1;
        height = 0;
        while(n < n_){
            n <<= 1;
            ++height;
        }
        f = f_;
        g = g_;
        h = h_;
        id1 = id1_;
        id2 = id2_;
        s = s_;

        node.assign(n << 1, id1);
        lazy.assign(n << 1, id2);
        length.assign(n << 1, 1);
        for(int i = n - 1 ; 0 < i ; --i){
            length[i] = length[i << 1] + length[(i << 1) | 1];
        }

        return;
    }

    void build(const std::vector<T>& dat, F f_, F g_, F h_, T id1_, T id2_, S s_ = [](T x, int len){ return x; }){
        int n_ = (int)dat.size();

        init(n_, f_, g_, h_, id1_, id2_, s_);

        for(int i = 0 ; i < n_ ; ++i){
            node[i + n] = dat[i];
        }

        for(int i = n - 1 ; 0 < i ; --i){
            node[i] = f(node[i << 1], node[(i << 1) | 1]);
        }

        return;
    }

    void update(int l, int r, T x){
        l += n;
        r += n - 1;

        evaluate(l, r);

        int tl = l;
        int tr = r;

        ++r;

        while(l < r){
            if(l & 1){
                lazy[l] = h(lazy[l], x);
                ++l;
            }
            l >>= 1;
            if(r & 1){
                --r;
                lazy[r] = h(lazy[r], x);
            }
            r >>= 1;
        }

        while(tl >>= 1, tr >>= 1, tl){
            if(lazy[tl] == id2){
                update(tl);
            }
            if(lazy[tr] == id2){
                update(tr);
            }
        }

        return;
    }

    T get(int l, int r){
        l += n;
        r += n - 1;

        evaluate(l, r);

        ++r;

        T res = id1;
        while(l < r){
            if(l & 1){
                evaluate(l);
                res = f(res, node[l]);
                ++l;
            }
            l >>= 1;
            if(r & 1){
                --r;
                evaluate(r);
                res = f(res, node[r]);
            }
            r >>= 1;
        }

        return res;
    }
};

#include<utility>

template<typename T>
class CoordinateCompression{
    std::vector<T> dat;
    int s;
    int n;

public:
    CoordinateCompression(const std::vector<T>& dat_, int s_ = 0, bool uni = true){
        build(dat_, s_, uni);
    }

    void build(const std::vector<T>& dat_, int s_ = 0, bool uni = true){
        dat = dat_;

        std::sort(dat.begin(), dat.end());
        if(uni){
            dat.erase(std::unique(dat.begin(), dat.end()), dat.end());
        }

        s = s_;

        n = (int)dat.size();

        return;
    }

    int get(T x){
        return (int)(std::lower_bound(dat.begin(), dat.end(), x) - dat.begin()) + s;
    }

    T restore(int k){
        return dat[k - s];
    }

    int size(void){
        return n;
    }
};

#include<iostream>
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    constexpr int INF = 1 << 30;

    int n, q;
    while(cin >> n >> q){
        vector<int> ti;

        vector<int> s(n), t(n), x(n);
        for(int i = 0 ; i < n ; ++i){
            cin >> s[i] >> t[i] >> x[i];
            ti.emplace_back(s[i] - x[i]);
            ti.emplace_back(t[i] - x[i]);
        }

        vector<int> d(q);
        for(int i = 0 ; i < q ; ++i){
            cin >> d[i];
            ti.emplace_back(d[i]);
        }

        CoordinateCompression<int> c(ti);

        auto cm = [](int l, int r){ return min(l, r); };
        LazySegmentTree<int> seg(c.size(), cm, cm, cm, INF, INF);
        for(int i = 0 ; i < n ; ++i){
            seg.update(c.get(s[i] - x[i]), c.get(t[i] - x[i]), x[i]);
        }

        for(int i = 0 ; i < q ; ++i){
            int tt = c.get(d[i]);
            int ans = seg.get(tt, tt + 1);
            if(ans < INF){
                cout << ans << '\n';
            }else{
                cout << "-1\n";
            }
        }
    }

    cout << flush;

    return 0;
}


Measured memory_bytes: 34796