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

#define NDEBUG
#include <cassert>


typedef long long ll;
typedef long double Double;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<long double> vD;

#define sz(a)  int((a).size())
#define pb  push_back
#define eb  emplace_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))
#define cons make_pair

#define PQ(T) priority_queue<T>
#define RPQ(T) priority_queue<T,vector<T>,greater<T>>

template<class T> inline void amin(T & a, T const & b) { a = min(a, b); }
template<class T> inline void amax(T & a, T const & b) { a = max(a, b); }

inline ll square(ll x) { return x * x; }
inline ll gcd(ll a, ll b) { while(a) swap(a, b%=a); return b; }
template <typename T>
inline T mod(T a, T b) { return ((a % b) + b) % b; }


template <typename T, typename OP>
class LazySegmentTree {
 public:
    using MERGE = function<T(T,T)>;
    using APPLY = function<T(T,OP)>;
    using MERGE_OP = function<OP(OP,OP)>;

    MERGE merge_data_func;
    APPLY apply_lazy_func;
    MERGE_OP merge_lazy_func;
    T elem_ident;
    OP op_ident;
    std::vector<T> data;
    std::vector<OP> lazy;
    int n, height;

    LazySegmentTree(MERGE f, APPLY g, MERGE_OP h, T elem_ident, OP op_ident)
        : merge_data_func(f), apply_lazy_func(g), merge_lazy_func(h),
          elem_ident(elem_ident), op_ident(op_ident) {
    }

    void init(int n_temp) {
        n = 1; height = 0;
        while (n < n_temp) { n <<= 1; ++height; }
        data.assign(2*n, elem_ident);
        lazy.assign(2*n, op_ident);
    }

    void build(const std::vector<T> &v){
        int n_temp = v.size();
        init(n_temp);
        std::copy(v.begin(), v.end(), data.begin()+n);
        for (int i=n-1; i>0; --i) {
            data[i] = merge_data_func(data[(i << 1)|0], data[(i << 1)|1]);
        }
    }

    inline T reflect_lazy(int k){
        if (lazy[k] == op_ident) {
            return data[k];
        } else {
            T applied = apply_lazy_func(data[k], lazy[k]);
            return applied;
        }
    }

    inline void eval(int k){
        if (lazy[k] == op_ident) return;
        lazy[(k << 1)|0] = merge_lazy_func(lazy[(k << 1)|0], lazy[k]);
        lazy[(k << 1)|1] = merge_lazy_func(lazy[(k << 1)|1], lazy[k]);
        data[k] = reflect_lazy(k);
        lazy[k] = op_ident;
    }

    inline void eval_down(int k) {
        for (int i=height; i>0; --i) {
            eval(k >> i);
        }
    }

    inline void merge_up(int k) {
        while (k >>= 1) {
            data[k] = merge_data_func(reflect_lazy((k << 1)|0), reflect_lazy((k << 1)|1));
        }
    }

    void update(int a, int b, OP x) {
        eval_down(a += n);
        eval_down(b += n-1);
        for (int l=a,r=b+1; l<r; l>>=1,r>>=1) {
            if (l&1) { lazy[l] = merge_lazy_func(lazy[l], x); ++l; }
            if (r&1) { --r; lazy[r] = merge_lazy_func(lazy[r], x); }
        }
        merge_up(a);
        merge_up(b);
    }

    void set_val(int a, T x) {
        eval_down(a += n);
        data[a] = x;
        lazy[a] = op_ident;
        merge_up(a);
    }

    T query(int a, int b) {
        eval_down(a += n);
        eval_down(b += n-1);
        T vl = elem_ident, vr = elem_ident;
        for (int l=a,r=b+1; l<r; l>>=1,r>>=1) {
            if (l & 1) {
                vl = merge_data_func(vl, reflect_lazy(l++));
            }
            if (r & 1) {
                vr = merge_data_func(reflect_lazy(--r), vr);
            }
        }
        T merged = merge_data_func(vl, vr);
        return merged;
    }

    void desc() {
    }
};

/*
* 区間更新区間max: elem_ident=op_ident=INT_MAX f=max(a,b) g=h=(b==INT_MAX?a:b)
* 区間加算区間和: elem_ident=op_ident=0 f=g=h=a+b p=a*b
* 区間加算区間min: elem_ident=op_ident=0 f=min(a,b) g=h=a+b
* 区間更新区間和: elem_ident=op_ident=0 f=a+b g=h=(b==0?a:b) p=a*b
* 区間xor区間和: elem_ident=op_ident=0 f=a+b g=(b>=1?b-a:a) h=a^b p=a*b

typedef pair<ll, ll> ll2;

int main() {
    int N, Q; scanf("%d%d", &N, &Q);
    auto f = [](ll2 a, ll2 b){ return ll2(a.first + b.first, a.second + b.second); };
    auto g = [](ll2 a, ll b){ return ll2(a.first + b*a.second, a.second); };
    auto h = [](ll a, ll b){ return a+b; };

    LazySegmentTree<ll2,ll> ch(f, g, h, ll2(0,0), 0);
    ch.build(std::vector<ll2>(N, ll2(0,1)));
    ch.desc();
    rep(i,Q) {
        int c; scanf("%d", &c);
        if (c) {
            int s, t;
            scanf("%d%d", &s, &t);
            printf("%lld\n", ch.query(s-1, t).first);
        } else {
            int s, t, x;
            scanf("%d%d%d", &s, &t, &x);
            ch.update(s-1, t, x);
        }
        ch.desc();
    }
    return 0;
}
*/

void solve(int N,int Q,vi& s,vi& t,vi& x,vi& d) {
    set<int> pos;
    rep(i,N) pos.insert(s[i]-x[i]);
    rep(i,N) pos.insert(t[i]-x[i]);
    rep(i,Q) { pos.insert(d[i]); pos.insert(d[i]+1); }
    int L=pos.size(), id=0;
    map<int,int> mp; vi mpR(L);
    for (int p: pos) {
        mpR[id] = p;
        mp[p] = id++;
    }
    rep(i,N) s[i] = mp[s[i]-x[i]];
    rep(i,N) t[i] = mp[t[i]-x[i]];
    rep(i,Q) d[i] = mp[d[i]];
    auto f = [](ll a, ll b){ return min(a,b); };

    LazySegmentTree<int,int> st(f,f,f,INT_MAX,INT_MAX);
    st.build(vi(L, INT_MAX));
    rep(i,N){
        st.update(s[i], t[i], x[i]);
    }
    rep(i,Q){
        int ans = st.query(d[i], d[i]+1);
        if (ans == INT_MAX) ans = -1;
        printf("%d\n", ans);
    }
}

int main() {
    int N, Q; scanf("%d %d%*c", &N, &Q);
    vi s(N),t(N),x(N);
    rep(i,N) {
        scanf("%d %d %d%*c", &s[i], &t[i], &x[i]);
    }
    vi d(Q);
    rep(i,Q) {
        scanf("%d%*c", &d[i]);
    }
    solve(N,Q,s,t,x,d);
    return 0;
}


Measured memory_bytes: 100992