#include <bits/stdc++.h>
#include <iomanip>      // std::setprecision
using namespace std;
#define what_is(x) cerr << #x << " is " << x << endl;
#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
#define max(a,b) (a<b?b:a)
#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define char2Int(c) (c-'0')
#define lastEle(vec) vec[vec.size()-1] 
#define SZ(x) ((int)((x).size()))
#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define REMIN(a,b) (a)=min((a),(b));
#define FENWICK(k) (k&-k)
#define FOREACH(i,t) for (auto i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
#define PRESENT(c,x) ((c).find(x) != (c).end()) 
#define CPRESENT(c,x) (find(ALL(c),x) != (c).end()) 
#define LL long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF 1001001001
#define PI 3.1415926535897932384626
//for map, pair
#define mp make_pair
#define fi first
#define se second
//for vectors
#define pb push_back
typedef int elem_t;
typedef vector<int> vi; 
typedef vector<vi> vvi; 
typedef pair<int,int> ii; 
// directions
const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};
const int rogi[4][2] = { {1,1}, {1,-1}, {-1,1}, {-1,-1} };


int n,q;
struct blokada {
	int pocz,kon, gdzie;
};

vector<blokada> blokady;

bool comp_block(blokada a, blokada b) {
	return a.pocz < b.pocz;
}

int ans[222222];
vector<ii> queries;
priority_queue<ii> acc;

void dodaj(int idx) {
	//cout<<"DODAJ : "<<idx<<endl;
	blokada blok = blokady[idx];
	acc.push(make_pair(-blok.gdzie, blok.kon));
}

int szukaj(int q) {
	//cout<<"q : "<<q<<endl;
	while(!acc.empty() && acc.top().second < q) {
		//cout<<"--Q: "<<q<<" "<<acc.top().second<<endl;
		acc.pop();
	}

	if(acc.empty()) return -1;
	return -acc.top().first;
}

void dane() {
	cin>>n>>q;
	F(i,0,n) {
		int a,b,x;
		cin>>a>>b>>x;

		blokada blok;
		blok.gdzie = x;
		blok.pocz = max(0, a-x);
		blok.kon = max(0, b-x-1);

		blokady.push_back(blok);
	}
	sort(ALL(blokady), comp_block);
	// F(i,0,n) {
	// 	cout<<blokady[i].pocz<<" "<<blokady[i].kon<<" "<<blokady[i].gdzie<<endl;
	// }
	F(i,0,q) {
		int a;
		cin>>a;
		queries.push_back(make_pair(a,i));
	}
	sort(ALL(queries));
	int acc_query = 0;
	F(i,0,n) {
		//cout<<i<<" "<<blokady[i].gdzie<<" --- "<<queries[acc_query].first<<acc_query<<endl;
		//jesli query jest mniejsze od poczatku kolejnego zap
		if(blokady[i].pocz <= queries[acc_query].first) {
			dodaj(i);
			continue;
		} 
		while(acc_query != q && queries[acc_query].first < blokady[i].pocz) {
			ans[queries[acc_query].second] = szukaj(queries[acc_query].first);
			//cout<<"WARTOSC : "<<szukaj(queries[acc_query].first)<<endl;
			acc_query++;
		}
		dodaj(i);
		
	}
	while(acc_query != q) {ans[queries[acc_query].second] = szukaj(queries[acc_query].first); acc_query++;}

	F(i,0,q) cout<<ans[i]<<endl;

}    


int main() {
	IOS
	// int t;
	// cin>>t;
	// F(i,0,t)
	    dane();
    return 0;
}

Measured memory_bytes: 9584