#include <iostream>
#include <cstdio>
#include <algorithm>
#include <map>
using namespace std;
const int N = 201000;
int n, m; 
map<int,int> projection;
int main(){
	scanf("%d%d", &n, &m);
	for( int i = 1, x, y, z; i <= n; ++i ){
		scanf("%d%d%d", &x, &y, &z);
		x-=z, y-=z+1;
		if( x < 0 && y < 0 )
			continue;
		else if( x < 0 )
			x = 0;
		else if( y < 0 )
			y = 0;
		while( x <= y ){
			if( !projection[x] || projection[x] > z )
				projection[x] = z;
			++x;
		}
	}
	for( int i = 1, x; i <= m; ++i ){
		scanf("%d", &x);
		if( projection[x] )
			printf("%d\n", projection[x]);
		else
			puts("-1");
	}
	return 0;
}