# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include<time.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
#include<fstream>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;// ;//1000000000 + 7 998244353 924844033 1000000000 + 9;
constexpr long long INF = numeric_limits<LL>::max();
constexpr long long DINF = 1000000000000;
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<double, double> Dll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
struct Fll { LL first, second, third, fourth; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Rrep(i,mf) for(LL i=mf-1;i>=0;i--)
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
struct Edge { LL to, cost; };
struct edge {
	LL from, to, cost;
};
vector<vector<Edge>>g;
vector<edge>ed;
vector<Pll>pv;
map<LL, LL>ma;
set<LL>st;
int di[4][2] = { { 0,1 },{ 1,0 },{ 0,-1 },{ -1,0 } };
LL n, m, k, p, q, w, h, ans, cnt,sum, a[310000], b[310000];
struct query {
	LL s, t, x;
};
query qu[210000];
string str[10000];
bool f;
char c[1100][1100];
map<int, int> zip;
int unzip[610000];
int compress(vector<int> &x) {
	sort(x.begin(), x.end());
	x.erase(unique(x.begin(), x.end()), x.end());
	for (int i = 0; i < x.size(); i++) {
		zip[x[i]] = i;
		unzip[i] = x[i];
	}
	return x.size();
}
struct Seg {
	LL n;
	vector<LL>node, lazy;
	Seg(LL n_) {
		n = 1; while (n < n_)n *= 2;
		node.resize(n * 2 - 1);
		lazy.resize(n * 2 - 1);
		rep(i, n)node[n + i - 1] = INF;
		Rrep(i, n - 2)node[i] =INF;
		//区間最小などの時
		rep(i, n * 2 - 1)lazy[i] = -1;
	}
	//区間の最小の遅延
	void ceval(LL k, LL l, LL r) {
		if (lazy[k] != -1) {
			node[k] = min(lazy[k],node[k]);
			if (r - l >= 1) {
				if (lazy[k * 2 + 1] != -1)
					lazy[k * 2 + 1] = min(lazy[k * 2 + 1], lazy[k]);
				else
					lazy[k * 2 + 1] = lazy[k];
				if (lazy[k * 2 + 2] != -1)
					lazy[k * 2 + 2] = min(lazy[k * 2 + 2], lazy[k]);
				else
					lazy[k * 2 + 2] = lazy[k];
			}
			lazy[k] = -1;
		}
	}
	void update(LL l, LL r, LL x) {
		update(0, x, 0, n - 1, l, r);
	}
	void update(LL i, LL x, LL a, LL b, LL l, LL r) {
		ceval(i, a, b);
		if (b < l || r < a)return;
		if (l <= a && b <= r) {
			if (lazy[i] != -1)
				lazy[i] = min(lazy[i], x);
			else
				lazy[i]=x;
			ceval(i, a, b);
		}
		else {
			update(i * 2 + 1, x, a, (a + b) / 2, l, r);
			update(i * 2 + 2, x, (a + b + 1) / 2, b, l, r);
			node[i] = min(node[i * 2 + 1], node[i * 2 + 2]);
		}
	}
	LL find(LL l, LL r) {
		return find(0, 0, n - 1, l, r);
	}
	LL find(LL i, LL a, LL b, LL l, LL r) {
		ceval(i, a, b);
		if (b < l || r < a)return INF;
		if (l <= a && b <= r)return node[i];
		return min(find(i * 2 + 1, a, (a + b) / 2, l, r), find(i * 2 + 2, (a + b + 1) / 2, b, l, r));
	}
};
Seg seg(600000);
int main() {
	cin >> n >> q;
	vector<int>pos, time;
	rep(i, n) {
		cin >> qu[i].s >> qu[i].t >> qu[i].x;
		pos.push_back(qu[i].x);
		time.push_back(qu[i].x - qu[i].t + 1);
		time.push_back(qu[i].x - qu[i].s);
	}
	rep(i, q) {
		cin >> a[i];
		time.push_back(-a[i]);
	}
	compress(time);
	rep(i, n) {
		seg.update( zip[qu[i].x - qu[i].t + 1],zip[qu[i].x - qu[i].s], qu[i].x);
	}
	rep(i, q) {
		LL num = seg.find(zip[-a[i]], zip[-a[i]]);
		cout << (num == INF ? -1 : num) << endl;
	}
	return 0;
}


Measured memory_bytes: 79076