#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
 
using namespace std;
 
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define repl(i,s,n) for(int i=s; i<=n; ++i)
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define ktya(x) sort(all(x))
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 1e18
#define INFLL 1000000000000000007LL
#define SIZE 200105
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mind(a,b) (a>b?b:a)
#define maxd(a,b) (a>b?a:b)

typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD = 1000000007;
//ll MOD=998244353;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
int N,Q;


const int BT = 1 << 17 ;
int n;
template <typename T>
//(N,0)とかで初期化
struct LazySegmentTree {
    int n;
    vector<T> data;
    vector<T> lazy;
    T INITIAL_DATA_VALUE;
    T INITIAL_LAZY_VALUE;
 
    //使うときは、この3つを適宜変更する
    static T merge(T x, T y);
    void updateNode(int k, T x);
    void apply(int k, int seg_len);
 
    void init(int size, T initial_data_value, T initial_lazy_value) {
        n = 1;
        INITIAL_DATA_VALUE = initial_data_value;
        INITIAL_LAZY_VALUE = initial_lazy_value;
        while (n < size) n *= 2;
        data.resize(2 * n - 1, INITIAL_DATA_VALUE);
        lazy.resize(2 * n - 1, INITIAL_LAZY_VALUE);
    }
 
    LazySegmentTree(int size, T initial_data_value, T initial_lazy_value) {
        init(size, initial_data_value, initial_lazy_value);
    }
 
    LazySegmentTree(int size, T initial_value) {
        init(size, initial_value, initial_value);
    }
 
    T getLeaf(int k) {
        return data[k + n - 1];
    }
 
    void eval(int k, int l, int r) {
        if (lazy[k] == INITIAL_LAZY_VALUE) return;
        apply(k, r - l);
        if (r - l > 1) {
            updateNode(2 * k + 1, lazy[k]);
            updateNode(2 * k + 2, lazy[k]);
        }
        lazy[k] = INITIAL_LAZY_VALUE;
    }
 
    //区間[a, b)に対する更新
    //k:節点番号, [l, r):節点に対応する区間
    void update(int a, int b, T x, int k, int l, int r) {
        eval(k, l, r);
        //[a, b)と[l, r)が交差しない場合
        if (r <= a || b <= l) return;
        //[a, b)が[l, r)を含む場合、節点の値
        if (a <= l && r <= b) {
            updateNode(k, x);
            eval(k, l, r);
        } else {
            update(a, b, x, k * 2 + 1, l, (l + r) / 2);
            update(a, b, x, k * 2 + 2, (l + r) / 2, r);
            data[k] = merge(data[2 * k + 1], data[2 * k + 2]);
        }
    }
 
    void update(int a, int b, T x) {
        update(a, b, x, 0, 0, n);
    }
 
    //区間[a, b)に対するクエリに答える
    //k:節点番号, [l, r):節点に対応する区間
    T query(int a, int b, int k, int l, int r) {
        eval(k, l, r);
        //[a, b)と[l, r)が交差しない場合
        if (r <= a || b <= l) return INITIAL_DATA_VALUE;
        //[a, b)が[l, r)を含む場合、節点の値
        if (a <= l && r <= b) return data[k];
        else {
            //二つの子をマージ
            T vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
            T vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
            return merge(vl, vr);
        }
    }
 
    //外から呼ぶ用
    T query(int a, int b) {
        return query(a, b, 0, 0, n);
    }
};
 
//使うときは以下3つを変更
template <typename T>
T LazySegmentTree<T>::merge(T x, T y) {
    return min(x, y);
}
 
template <typename T>
void LazySegmentTree<T>::updateNode(int k, T x) {
    lazy[k] =  min(lazy[k],x);
}
 
template <typename T>
void LazySegmentTree<T>::apply(int k, int seg_len) {
    data[k] =min(lazy[k],data[k]);
}
vector<ll> dist;

vector< pair<ll,pair<ll,ll> > > hoge;
int bil(ll fuga){
	int ng=-1,ok=Q;
	while(ok-ng>1){
		int mid=(ok+ng)/2;
		if(dist[mid]>=fuga)ok=mid;
		else ng=mid;
	}
	return ok;
}
int bir(ll fuga){
	int ng=Q,ok=-1;
	while(ng-ok>1){
		int mid=(ok+ng)/2;
		if(dist[mid]<=fuga)ok=mid;
		else ng=mid;
	}
	return ok;
}
int main(){
	cin>>N>>Q;
	LazySegmentTree<ll> segm(Q+1,1000000010);
	for(int i=0;i<N;i++){
		ll s,t,x;
		cin>>s>>t>>x;
		hoge.pb(mp(x,mp(s-x,t-x-1)));
	}
	sort(all(hoge));
	reverse(all(hoge));
	rep(i,Q){
		ll x;
		cin>>x;
		dist.pb(x);
	}
	rep(i,N){
		ll x=hoge[i].first;
		ll a=hoge[i].second.first;
		ll b=hoge[i].second.second;
		//cout<<x<<" "<<a<<" "<<b<<endl;
		int l = bil(a);
		int r =bir(b);
		if(l<=r)segm.update(l,r+1,x);
	}
	rep(i,Q){
		if(segm.query(i,i+1)==1000000010)cout<<-1<<endl;
		else cout<<segm.query(i,i+1)<<endl;
	}
}

Measured memory_bytes: 19308