#include<bits/stdc++.h>
#define lowbit(a) ((a)&(-(a)))
using namespace std;

void file(bool opt)
{
	if (opt&&fopen("in.txt", "r"))
	{
		freopen("in.txt", "r", stdin);
		//freopen("out.txt", "w", stdout);
	}
}

int n, q, cnt = 0;

struct node {
	int t, d, x;
}c[1000000 + 5];

bool cmp(node a, node b)
{
	return a.t < b.t;
}

multiset<int>que;

int main()
{
	file(1);
	scanf("%d%d", &n, &q);
	for (int i = 1; i <= n; i++)
	{
		int s, t, x;
		scanf("%d%d%d", &s, &t, &x);
		s -= x, t -= x;
		cnt++;
		c[cnt].t = s, c[cnt].x = x, c[cnt].d = 1;
		cnt++;
		c[cnt].t = t, c[cnt].x = x, c[cnt].d = -1;
	}
	sort(c + 1, c + 1 + cnt, cmp);
	int cc = 1;
	while (q--)
	{
		int d;
		scanf("%d", &d);
		while (c[cc].t <= d && cc <= cnt)
		{
			if (c[cc].d == 1)
				que.insert(c[cc].x);
			else
				que.erase(que.find(c[cc].x));
			cc++;
		}
		if (que.size())
			printf("%d\n", *que.begin());
		else
			printf("-1\n");
	}
	return 0;
}
