#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[])
{
	int n,q;
	cin>>n>>q;
	vector<pair<pair<long long,int>,long long>> v;
	long long s,t,x;
	for (int i = 0; i < n; ++i)
	{
		cin>>s>>t>>x;
		v.emplace_back(make_pair(make_pair(s-x,-1),x));
		v.emplace_back(make_pair(make_pair(t-x,0),x));
	}
	long long d;
	for (int i = 0; i < q; ++i)
	{
		cin>>d;
		v.emplace_back(make_pair(make_pair(d,1),i));
	}
	sort(v.begin(), v.end());
	multiset<long long> memo={};
	for (auto i = v.begin(); i != v.end(); ++i)
	{
		auto p=*i;
		if (p.first.second==-1)
		{
			memo.insert(p.second);
		}
		else if (p.first.second==0)
		{
			memo.erase(memo.lower_bound(p.second));
		}
		else
		{
			if (memo.size()>0)
			{
				cout<<*memo.begin()<<endl;
			}
			else
			{
				cout<<"-1\n";
			}
		}
	}
	return 0;
}
