#include "bits/stdc++.h"

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

struct RMQandRUQ {
	int n;
	vector<int>d, lazy;
	RMQandRUQ(int m) {
		for (n = 1; n < m; n <<= 1);
		d.assign(2 * n, INF);
		lazy.assign(2 * n, -1);
	}
	void eval(int k, int l, int r) {
		if (lazy[k] != -1) {
			d[k] = lazy[k];
			if (r - l > 1)lazy[2 * k] = lazy[2 * k + 1] = lazy[k], lazy[k] = -1;
			lazy[k] = -1;
		}
	}
	void update(int a, int b, int x, int k = 1, int l = 0, int r = -1) {
		if (r == -1)r = n;
		eval(k, l, r);
		if (r <= a || b <= l)return;
		if (a <= l && r <= b) {
			lazy[k] = x;
			eval(k, l, r);
			return;
		}
		else {
			update(a, b, x, 2 * k, l, (l + r) / 2);
			update(a, b, x, 2 * k + 1, (l + r) / 2, r);
			d[k] = min(d[2 * k], d[2 * k + 1]);

		}
	}
	int find(int a, int b, int k = 1, int l = 0, int r = -1) {
		if (r == -1)r = n;

		eval(k, l, r);

		if (r <= a || b <= l)return INF;
		if (a <= l && r <= b) {
			return d[k];
		}
		else {
			int vl, vr;
			vl = find(a, b, 2 * k, l, (l + r) / 2);
			vr = find(a, b, 2 * k + 1, (l + r) / 2, r);
			return min(vl, vr);
		}

	}
};
template<typename T>
struct RangeUpdateQuery {
	int n;
	vector<T>d;
	RangeUpdateQuery(int m) {
		for (n = 1; n < m; n <<= 1);
		d.assign(2 * n, INF);
	}
	int get(int i) {
		update(i, i + 1, -1);
		return d[n + i];
	}
	void update(int a, int b, T x) {
		return update(a, b, x, 1, 0, n);
	}
	void update(int a, int b, T x, int k, int l, int r) {
		// [a,b) [l,r)
		if (r <= a || b <= l)return;
		else if (a <= l && r <= b) {
			if (x >= 0)chmin(d[k], x);
			return;
		}
		else {
			// [l,r) �̂ǂ�����ύX����ƂȂ�ƁA
			// d[ [l,r) ] == z(�����l)  ���ۂĂȂ��Ȃ�̂Ŏq�ɒl���ڂ�
			// 
			if (d[k] != INF) {
				chmin(d[2 * k], d[k]);
				chmin(d[2 * k + 1], d[k]);
				d[k] = INF;
			}
			update(a, b, x, 2 * k, l, (l + r) / 2);
			update(a, b, x, 2 * k + 1, (l + r) / 2, r);
		}
	}
};

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int N, Q; cin >> N >> Q;
	vector<int>S(N), T(N), X(N); rep(i, 0, N) { cin >> S[i] >> T[i] >> X[i]; }
	vector<int>D(Q); rep(i, 0, Q) { cin >> D[i]; }
	RangeUpdateQuery<int> seg(Q);

	rep(i, 0, N) {
		int s = S[i] - X[i];
		int t = T[i] - X[i];

		auto lb = lower_bound(all(D), s) - D.begin();
		auto ub = lower_bound(all(D), t) - D.begin();
		seg.update(lb, ub, X[i]);
	}

	rep(i, 0, Q) {
		int x = seg.get(i);
		if (x == INF) {
			x = -1;
		}
		cout << x << endl;
	}


	return 0;
}


Measured memory_bytes: 12928