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

int main() {
	int N, Q;
	cin >> N >> Q;
	vector<tuple<int, int, int>>stx(N);
	for (int n = 0;n<N;++n) {
		cin >> get<1>(stx[n]) >> get<2>(stx[n]) >> get<0>(stx[n]);
	}
	sort(stx.begin(), stx.end());

	set<pair<int, int>> d;
	for (int i = 0, x; i < Q; ++i) {
		cin >> x;
		d.emplace(x, i);
	}

	vector<long long>tm(Q, -1);
	for (int i = 0;i<N;++i) {
		auto first = d.lower_bound(make_pair(get<1>(stx[i]) - get<0>(stx[i]), 0));
		auto end = d.upper_bound(make_pair(get<2>(stx[i]) - get<0>(stx[i]) - 1, Q));

		for (auto it = first; it != end; ++it) {
			tm[it->second] = get<0>(stx[i]);
		}
		d.erase(first, end);
	}
	for (int i = 0; i < Q; ++i) cout << tm[i] << '\n';
	return 0;
}
#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <bitset>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()

#pragma region UnionFind
struct UnionFind
{
	vector<int> par;

	UnionFind(int n) : par(n, -1) {}
	void init(int n) { par.assign(n, -1); }

	int root(int x)
	{
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool issame(int x, int y)
	{
		return root(x) == root(y);
	}

	bool merge(int x, int y)
	{
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x)
	{
		return -par[root(x)];
	}
};
#pragma endregion
#pragma region GCD
ll gcd(ll a, ll b)
{
	if (b == 0)return a;
	return gcd(b, a%b);
}
#pragma endregion
#pragma region LCM
ll lcm(ll a, ll b)
{
	return a / gcd(a, b) * b;
}
#pragma endregion
#pragma region chmin
template<class T> inline bool chmin(T& a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region chmax
template<class T> inline bool chmax(T& a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma endregion

#pragma region イベントソート
using type = pair<int, ll>; // 1: query, 0; delete, -1: insert
using event = pair<ll, type>;
#pragma endregion

int main()
{
	int n, q; cin >> n >> q;
	vector<event> v;
	rep(i, n)
	{
		ll s, t, x; cin >> s >> t >> x;
		v.push_back({ s - x,{-1,x} });
		v.push_back({ t - x,{0,x} });
	}
	rep(i, q)
	{
		ll d; cin >> d;
		v.push_back({ d,{1,0} });
	}
	sort(all(v));
	multiset<ll> s;
	for (auto p : v)
	{
		ll e = p.second.first;
		ll pos = p.second.second;
		if (e == -1) s.insert(pos);
		else if (e == 0)s.erase(s.lower_bound(pos));
		else
		{
			if (s.empty())cout << -1 << endl;
			else cout << *s.begin() << endl;
		}
	}
}