#include <bits/stdc++.h>
using namespace std;
#define int long long   // aaaaaaaaaaaaaaaaaa
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(),(x).rend()
#define in(s,x) s.find(x) != s.end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define SIZE(buff) (sizeof(buff)/sizeof(buff[0]))
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<pair<int,int>> VPII;
const ll mod=1000000007;
const ll INF= 1LL<<60-1;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
void chmin(int64_t& a, int64_t b){
    a = min(a, b);
}
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
template<typename T, typename U>ostream& operator << (ostream& os, pair<T, U>& pair_var)
{os << "(" << pair_var.first << ", " << pair_var.second << ")";return os;}
// head


int m,n,k,res,tmp,tmp2,tmp3,h,w,ans;
//int a[5200] = {};
int a[300000][3];
deque<PII> que;
string s;
map<int,VPII> kukan;
vector<PII> g[3000];
//int dp[200000];
int flag;
//VPII g2[200000];
int cost[200005];
double dp[1020][2] = {};
double dp2[1020][2] = {};
//VVI g(200005);

int size;
vector<long long> val;
vector<long long> lazy;

void lazy_propagate(int p) {
    if (lazy[p] != -1) {
        val[p] = lazy[p];
        if (p < size-1) {
            lazy[p*2+1] = lazy[p];
            lazy[p*2+2] = lazy[p];
        }
        lazy[p] = -1;
    }
}

void update(int wishl, int wishr, int watchl, int watchr, int k, int x) {
    if (wishr <= watchl || watchr <= wishl) {
        lazy_propagate(k);
        return;
    }
    if (wishl <= watchl && watchr <= wishr) {
        lazy[k] = x;
        lazy_propagate(k);
        return;
    }
    int mid = (watchl+watchr)/2;
    lazy_propagate(k);
    update(wishl, wishr, watchl, mid, k*2+1, x);
    update(wishl, wishr, mid, watchr, k*2+2, x);
    val[k] = min(val[k*2+1], val[k*2+2]);
}
void update(int wishl, int wishr, int x) {
    update(wishl, wishr, 0, size, 0, x);
}

long long getmin(int wishl, int wishr, int watchl, int watchr, int k) {
    if (wishr <= watchl || watchr <= wishl) {
        return INF;
    }
    if (wishl <= watchl && watchr <= wishr) {
        lazy_propagate(k);
        return val[k];
    }
    int mid = (watchl+watchr)/2;
    lazy_propagate(k);
    long long ml = getmin(wishl, wishr, watchl, mid, k*2+1);
    long long mr = getmin(wishl, wishr, mid, watchr, k*2+2);
    return min(ml, mr);
}
long long getmin(int wishl, int wishr) {
    return getmin(wishl, wishr, 0, size, 0);
}


int q;
int d[300000];
VI v;
vector<pair<int,pair<int,int>>> sine;

signed main() {
	cin.tie(0);
  ios::sync_with_stdio(false);
	cin>>n>>q;
  rep(i,0,n){cin>>a[i][0]>>a[i][1]>>a[i][2];v.pb(a[i][0]-a[i][2]);v.pb(a[i][1]-1-a[i][2]);}
  rep(i,0,q){cin>>d[i];v.pb(d[i]);}
  map<int,int> mp;
  for(int i=0;i<v.size();i++) mp[v[i]]=-1;
  int idx=0;
  for(auto &p:mp) p.second=(idx++);
  size = 1;
  while (size < mp.size()) size <<= 1;
  val = vector<long long>(size*2, (INF));
  lazy = vector<long long>(size*2, -1);
  rep(i,0,n){sine.pb({a[i][2],{a[i][0],a[i][1]}});}
  sort(all(sine));
  per(i,0,n-1){update(mp[sine[i].se.fi-sine[i].fi],mp[sine[i].se.se-sine[i].fi-1]+1,sine[i].fi);
//  cout<<mp[a[i][0]-a[i][2]]<<endl;
  }
  rep(i,0,q){
    m = getmin(mp[d[i]],mp[d[i]]+1);
//    cout<<mp[d[i]]<<endl;
    if(m == INF){cout<<-1<<endl;}
    else{cout<<m<<endl;}
  }
//  cout<<val<<endl;
}

Measured memory_bytes: 98408