#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <tuple>
#include <set>

using namespace std;

using TUP = tuple<int, int, int>;
using PII = pair<int, int>;

int main() {
	int n, q, s, t, x, d;
	cin >> n >> q;

	vector<TUP> queries;
	for (int i = 0; i < n; i++) {
		cin >> s >> t >> x;

		queries.emplace_back(make_tuple(x, s, t));
	}
	sort(queries.begin(), queries.end());

	set<PII> ds;
	for (int i = 0; i < q; i++) {
		cin >> d;
		ds.insert(make_pair(d, i));
	}

	vector<int> ans(q, -1);
	for (auto query: queries) {
		tie(x, s, t) = query;
		// printf("query %3d %3d %3d: %3d %3d\n", x, s, t, s - x, t - x);

		auto it = ds.lower_bound(make_pair(s - x, 0));

		while (it != ds.end()) {
			if (it->first >= t - x) {
				break;
			}
			ans[it->second] = x;
			ds.erase(it++);
		}

	}

	for (auto z: ans) {
		cout << z << endl;
	}
	return 0;
}
