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

// fundamental
using ll = long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)
#define FOR(i,s,n) for (ll i = (s); i < (n); ++i)
#define ALL(c) (c).begin(), (c).end()
#define TEN(x) ((ll)1e##x)
#define MAXC(c,x) (c = max(c, x))
#define MINC(c,x) (c = min(c, x))
const ll mod = TEN(9) + 7;

// vector
using vl = vector<ll>; using vvl = vector<vl>; using vvvl = vector<vvl>;
template<class T, size_t N, class A = size_t> auto mdv(A size = 0) -> typename enable_if<N==1, vector<T>>::type { return vector<T>(size); }
template<class T, size_t N, class A = size_t> auto mdv(A size = 0) -> vector<decltype(mdv<T, N - 1>())> { return vector<decltype(mdv<T, N - 1>())>(size); }
template<class T, size_t N, class A, class... B> auto mdv(A size, B... rest) -> typename enable_if<N!=1, vector<decltype(mdv<T, N - 1>(rest...))>>::type { return vector<decltype(mdv<T, N - 1>(rest...))>(size, mdv<T, N - 1>(rest...)); }
template<class T, class... A> auto mdv(A... size) -> decltype(mdv<T, sizeof...(size), A...>(size...)) { return mdv<T, sizeof...(size), A...>(size...); }
// template<size_t N, class A, class... B> auto mdvl(A size, B... rest) -> decltype(mdv<N, ll, A, B...>(size, rest...)) { return mdv<N, ll, A, B...>(size, rest...); }

// template<class T, class A> auto mdv(A size) -> vector<T> { return vector<T>(size); }
// template<class T, class A, class... B> auto mdv(A size, B... rest) -> vector<decltype(mdv<T>(rest...))> { return vector<decltype(mdv<T>(rest...))>(size, mdv<T>(rest...)); }

// io
template<class T> istream& operator >>(istream& is, vector<T>& vec){ for(T& x: vec) is >> x; return is; }
template<class T, class U> istream& operator >>(istream& is, pair<T, U>& p){ is >> p.first >> p.second; return is; }
template<class T> void input(T& t) { cin >> t; assert(cin); } template<class T, class... Ts> void input(T& t, Ts&... ts) { cin >> t; input(ts...); }
template<class T> void print(T&& t) { cout << t; } template<class T, class... Ts> void print(T&& t, Ts&&... ts) { cout << t; print(ts...); }
template<class T> void println(T&& t) { cout << t << endl; } template<class T, class... Ts> void println(T&& t, Ts&&... ts) { cout << t; println(ts...); }
template<class T> string join(const vector<T>& v, const string & sep) { stringstream ss; REP(i, v.size()) ss << (i != 0 ? sep : "") << v[i]; return ss.str(); }

const ll INF = 1e9;

template <typename T>
struct MinStarrySkyTreeTraits {
	typedef T value_type;
	T default_value() const { return INF; }
	T operator()(const T &a, const T &b) const { return min(a, b); }
};

template <typename T>
struct MaxStarrySkyTreeTraits {
	typedef T value_type;
	T default_value() const { return -INF; }
	T operator()(const T &a, const T &b) const { return max(a, b); }
};

struct AddStarrySkyTreeUpdateTraits{
	template <class T, class U>
	auto operator()(T&& t, U&& u) const -> decltype(std::forward<T>(t) + std::forward<U>(u)){
		return std::forward<T>(t) + std::forward<U>(u);
	}
};


struct MinStarrySkyTreeUpdateTraits{
	template <class T, class U>
	auto operator()(T&& t, U&& u) const -> decltype(std::min(t, u)){
		return std::min(t, u);
	}
};

struct ChangeStarrySkyTreeUpdateTraits{
	template <class T, class U>
	auto operator()(T&& t, U&& u) const -> decltype(std::forward<U>(u)){
		return std::forward<U>(u);
	}
};

template <class Traits, class UpdateTraits>
class StarrySkyTree {
public:
	typedef typename Traits::value_type value_type;
private:
	Traits traits;
	UpdateTraits updateTraits;
	vector<value_type> seg, lazy;
	size_t size;
private:
	void initialize(){
		if(size < 2) return;
		for(auto i = size - 2;; --i){
			seg[i] = traits(seg[i * 2 + 1], seg[i * 2 + 2]);
			if(i == 0) break;
		}
	}
	void push(size_t k, size_t l, size_t r) {
		if (lazy[k] == traits.default_value()) return;
		seg[k] = updateTraits(seg[k], lazy[k]);
		if (r - l > 1) {
			lazy[k * 2 + 1] = updateTraits(lazy[k * 2 + 1], lazy[k]);
			lazy[k * 2 + 2] = updateTraits(lazy[k * 2 + 2], lazy[k]);
		}
		lazy[k] = traits.default_value();
	}
	void update(size_t a, size_t b, const value_type & v, size_t k, size_t l, size_t r) {
		push(k, l, r);
		if (r <= a || b <= l) return; //範囲外
		if (a <= l && r <= b) {        //[l,r) ⊂ [a,b)
			lazy[k] = updateTraits(lazy[k], v);
			push(k, l, r);
		} else {                       //[l,r)の一部が[a,b)に含まれる
			update(a, b, v, k * 2 + 1, l, (l + r) / 2);
			update(a, b, v, k * 2 + 2, (l + r) / 2, r);
			seg[k] = traits(seg[k * 2 + 1], seg[k * 2 + 2]);
		}
	}
	// [a,b)の範囲について扱う
	// k     : 現在見ている接点の番号
	// [l,r) : kに対応した範囲
	value_type query(size_t a, size_t b, size_t k, size_t l, size_t r) {
		push(k, l, r);
		if (r <= a || b <= l) return traits.default_value(); //範囲外
		if (a <= l && r <= b) return seg[k];                 //[l,r) ⊂ [a,b)
		
		//[l,r)の一部が[a,b)に含まれる
		const value_type & vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
		const value_type & vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
		return traits(vl, vr);
	}
public:
	explicit StarrySkyTree(
		size_t n, const Traits &traits = Traits(),
		const UpdateTraits & updateTraits = UpdateTraits()
	) : size(1), traits(traits), updateTraits(updateTraits) {
		while (size < n) size *= 2;
        seg.resize(size * 2 - 1, traits.default_value());
        lazy.resize(size * 2 - 1, traits.default_value());
        initialize();
	}
	template <typename Iterator>
	StarrySkyTree(
		Iterator first, Iterator last, const Traits &traits = Traits(),
		const UpdateTraits & updateTraits = UpdateTraits()
	) : size(1), traits(traits), updateTraits(updateTraits) {
		const size_t n = distance(first, last);
		while(size < n) size *= 2;
		seg.resize(size * 2 - 1, traits.default_value());
        lazy.resize(size * 2 - 1, traits.default_value());
		copy(first, last, seg.begin() + size - 1);
		initialize();
	}
	void update(size_t a, size_t b, const value_type & v) { update(a, b, v, 0, 0, size); }
	value_type query(size_t a, size_t b) { return query(a, b, 0, 0, size); }
	value_type query(size_t i) { return query(i, i + 1); }
	value_type query() { return query(0, size); }
};


int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(50);
    ll n, q; cin >> n >> q;
	vl s(n), t(n), x(n);
	REP(i,n) cin >> s[i] >> t[i] >> x[i];
	vl d(q); REP(i, q) cin >> d[i];

	map<ll, ll> d2idx;
	{
		set<ll> zaatu;
		REP(i, n) {
			zaatu.insert(s[i] * 2 - 1 - x[i] * 2);
			zaatu.insert(t[i] * 2 - 1 - x[i] * 2);
		}
		REP(i, q) zaatu.insert(d[i] * 2);
		ll idx = 0;
		for (auto x : zaatu) d2idx[x] = idx++;
	}
	StarrySkyTree<MinStarrySkyTreeTraits<ll>, MinStarrySkyTreeUpdateTraits> st(d2idx.size());
	REP(i, n) {
		ll sd = s[i] * 2 - 1 - x[i] * 2;
		ll td = t[i] * 2 - 1 - x[i] * 2;
		st.update(d2idx[sd], d2idx[td] + 1, x[i]);
	}
	REP(i, q) {
		ll dd = d[i] * 2;
		ll ans = st.query(d2idx[dd]);
		cout << (ans == MinStarrySkyTreeTraits<ll>().default_value() ? -1 : ans) << endl;
	}
}


Measured memory_bytes: 89472