#include <bits/stdc++.h>

using namespace std;
using llong = long long;
using ldbl = long double;
using P = pair<llong, llong>;
using PP = pair<P, llong>;

#define ALL(x) x.begin(), x.end()

const llong inf = 1100100100100100ll;
const llong mod = 1e9+7;

int main() {
	llong N, Q;
	vector<PP> event;

	cin >> N >> Q;
	event.resize(N*2 + Q);

	llong S, T, X;
	for (int i = 0; i < N; i++) {
		cin >> S >> T >> X;
		event[i] = PP(P(S-X,1), X);
		event[i+N] = PP(P(T-X,0), X);
	}
	llong D;
	for (int i = 0; i < Q; i++) {
		cin >> D;
		event[N*2 + i] = PP(P(D,2), 0);
	}

	sort(ALL(event));
	set<llong> s;
	for (auto eve : event) {
		int tm = eve.first.first;
		int id = eve.first.second;
		int pos = eve.second;

		if (id == 0) {
			s.erase(pos);
		} else if (id == 1) {
			s.insert(pos);
		} else {
			if (s.size() == 0)
				cout << -1 << endl;
			else
				cout << *s.begin() << endl;
		}
	}

	return 0;
}