#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);++i)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const int MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  int n,q;
  cin >> n >> q;
  vector<tuple<int,int,int>> stx(n);
  rep(i,n){
    cin >> get<1>(stx[i]) >> get<2>(stx[i]) >> get<0>(stx[i]);
  }
  sort(stx.begin(),stx.end());
  
  set<P> st;
  rep(i,q){
    int x;
    cin >> x;
    st.emplace(x,i);
  }
  
  vector<int> ans(q,-1);
  rep(i,n){
    int s = get<1>(stx[i]);
    int t = get<2>(stx[i]);
    int x = get<0>(stx[i]);
    //xの昇順で考えてぶつかったら，その人をerase
    auto first = st.lower_bound(P(s-x,0));//引っかかる人
    auto end = st.upper_bound(P(t-x-1,q));//引っかからない人
    
    for(auto it = first; it !=end; ++it) ans[it->second] = x;
    
    st.erase(first,end);
  }
  
  rep(i,q) cout << ans[i] << endl;
  return 0;
}

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

using ll = long long;

const ll INF = 1e18;

const int S = 1 << 18;
ll seg[2*S];

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int N, Q; cin >> N >> Q;
	vector<pair<pair<ll, ll>, ll>> blocks(N);
	for (int i = 0; i < N; i++) {
		ll s, t, x; cin >> s >> t >> x;
		s -= x, t -= x;
		blocks[i] = {{s,t}, x};
	}
	vector<ll> D(Q);
	for (int q = 0; q < Q; q++) {
		cin >> D[q];
	}

	for (int i = 0; i < 2 * S; i++) {
		seg[i] = INF;
	}

	for (int i = 0; i < N; i++) {
		ll s = blocks[i].first.first, t = blocks[i].first.second, x = blocks[i].second;
		int si = int(lower_bound(D.begin(), D.end(), s) - D.begin());
		int ti = int(lower_bound(D.begin(), D.end(), t) - D.begin());
		for (int a = S+si, b = S+ti; a < b; a /= 2, b /= 2) {
			if (a & 1) {
				seg[a] = min(seg[a], x);
				a++;
			}
			if (b & 1) {
				--b;
				seg[b] = min(seg[b], x);
			}
		}
	}
	for (int i = 1; i < S; i++) {
		seg[2*i+0] = min(seg[2*i+0], seg[i]);
		seg[2*i+1] = min(seg[2*i+1], seg[i]);
	}
	for (int i = 0; i < Q; i++) {
		if (seg[S+i] == INF) cout << -1 << '\n';
		else cout << seg[S+i] << '\n';
	}
	return 0;
}
