#include <cstdio>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <queue>
#include <map>
#include <set>
#include <stack>
using namespace std;
#define ll long long
#define ull unsigned long long
#define up(i, a, b) for (int i = (a); i <= (b); i++)
#define down(i, a, b) for (int i = (a); i >= (b); i--)
#define mem(x, y) memset(x, (y), sizeof x)
#define ff first
#define ss second
#define mp(x, y) make_pair(x, y)
#define pb(x) push_back(x)
#define sc(a) scanf("%d", &a)
#define scl(a) scanf("%lld", &a)
#define scs(a) scanf("%s", a)
#define pr(a, b) printf("%d%c", a, b)
#define prl(a, b) printf("%lld%c", a, b)
#define PQ priority_queue
#define ld long double
#define all(v) v.begin(), v.end()
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef vector<int> V;

int c[400010];
struct node {
	int s,t,x;
};
node a[400010];
bool cmp(node a,node b) {
	return a.x<b.x;
}
int ans[400010];
node doo[400010];
inline int read() {
	int x=0;
	char c=getchar();
	for(; isdigit(c); c=getchar()) x=x*10+c-'0';
	return x;
}
int main() {
	int n=read(),q=read();
	up(i,1,n) {
		a[i].s=read();a[i].t=read();a[i].x=read();
	}
	sort(a+1,a+1+n,cmp);
	up(i,1,q) {
		int x=read();
		c[i]=x;
	}

	up(i,1,n) {
		auto l=lower_bound(c+1,c+1+n,a[i].s-a[i].x)-c;
		auto r=lower_bound(c+1,c+1+n,a[i].t-a[i].x)-1;

		doo[i].s=l,doo[i].s=r,doo[i].x=a[i].x;
	}
	int f=1;
	up(i,1,q)
	
	up(i,1,q)
	if(ans[i]==0)pr(-1,'\n');
	else pr(ans[i],'\n');
}