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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef vector<vector<long long>> VVL;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

#define en "\n"

const double EPS = 1e-9;
const double PI  = acos(-1.0);
const int INF = 2147483647;
const long long LINF = 1LL<<60;
const long long MOD = 1000000007; // 998244353

#define CLR(a) memset((a), 0, sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

template <typename T,typename E>
struct LazySegmentTree{
    typedef function<T(T,T)> F;
    typedef function<T(T,E)> G;
    typedef function<E(E,E)> H;
    typedef function<E(E,int)> P;
    int n;
    F f;
    G g;
    H h;
    P p;
    T d1;
    E d0;
    vector<T> val;
    vector<E> lazy;

    LazySegmentTree(vector<T> a, F f_, G g_, H h_, T d1_, E d0_, P p_=[](E a,int b){return a;}):
        f(f_),g(g_),h(h_),d1(d1_),d0(d0_),p(p_){

        int sz = a.size();
        n = 1;
        while (n < sz) n <<= 1;
        val.clear();
        val.resize(2 * n - 1, d1);
        lazy.clear();
        lazy.resize(2 * n - 1, d0);
        for (int i = 0; i < sz; i++) val[i + n - 1] = a[i];
        for (int i = n - 2; i >= 0; i--) val[i] = f(val[i * 2 + 1], val[i * 2 + 2]);
    }

    inline void eval(int k, int len){
        if(lazy[k] == d0) return;

        if(2*k+1 < 2*n-1){
            lazy[2*k+1] = h(lazy[2*k+1], lazy[k]);
            lazy[2*k+2] = h(lazy[2*k+2], lazy[k]);
        }
        val[k] = g(val[k], p(lazy[k], len));
        lazy[k] = d0;
    }

    void update(int a, int b, E x, int k=0, int l=0, int r=-1){
        // 0-indexed
        // [a,b)に対して操作
        if(r < 0) r = n;
        eval(k, r-l);
        if(r <=a || b <= l) return;

        if(a <= l && r <= b){
            lazy[k] = h(lazy[k], x);
            eval(k, r-l);
        }
        else{
            update(a, b, x, 2*k+1, l, (l+r)/2);
            update(a, b, x, 2*k+2, (l+r)/2, r);
            val[k] = f(val[2*k+1], val[2*k+2]);
        }
    }

    T query(int a, int b, int k=0, int l=0, int r=-1){
        // 0-indexed
        // [a,b)に対してquery
        if(r < 0) r = n;
        eval(k, r-l);
        if(r <= a || b <= l) return d1;
        if(a <= l && r <= b) return val[k];
        T val_l = query(a, b , 2*k+1, l, (l+r)/2);
        T val_r = query(a, b , 2*k+2, (l+r)/2, r);
        return f(val_l, val_r);
    }
};

int main(void){
    auto f = [](int a, int b){return min(a,b);};
    auto g = [](int a, int b){return min(a,b);};
    auto h = [](int a, int b){return min(a,b);};
    int N,Q; cin >> N >> Q;
    VI S(N), T(N), X(N); REP(i,N) cin >> S[i] >> T[i] >> X[i];
    VI D(Q); REP(i,Q) cin >> D[i];
    LazySegmentTree<int,int> st(VI(Q,INF), f, g, h, INF, INF);

    REP(i,N){
        int l = LB(D, S[i]-X[i]), r = LB(D, T[i]-X[i]);
        st.update(l, r, X[i]);
    }

    REP(i,Q){
        int ans = st.query(i, i+1);
        cout << (ans<INF ? ans : -1) << en;
    }
    return 0;
}

Measured memory_bytes: 9072