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

int main(){
  long long n,q;
  cin >> n >> q;
  long long s[n],t[n],x[n],d[q];
  pair<long long, int> p[n];
  for(int i=0;i<n;i++){
    cin >> s[i] >> t[i] >> x[i];
    p[i]=make_pair(x[i], i);
  }
  sort(p, p+n);
  vector<pair<long long, int> > vec;
  bool active[n];
  for(int i=0;i<n;i++){
    vec.push_back(make_pair(s[p[i].second]-x[p[i].second]-1, i));
    vec.push_back(make_pair(t[p[i].second]-x[p[i].second]-1, i));
    active[i]=false;
  }
  for(int i=0;i<q;i++){
    cin >> d[i];
    vec.push_back(make_pair(d[i], -1));
  }
  sort(vec.begin(), vec.end());
  priority_queue<int, vector<int>, greater<int> > que;
  for(size_t i=0;i<vec.size();i++){
    if(vec[i].second == -1){
      if(!que.empty()){
        cout << p[que.top()].first << endl;
      }else{
        cout << -1 << endl;
      }
    }else{
      long long idx = vec[i].second;
      if(active[idx]){ //工事終了
        active[idx] = false;
        if(idx == que.top()){
          que.pop();
          while(!que.empty()){
            if(active[que.top()]){
              break;
            }else{
              que.pop();
            }
          }
        }
      }else{ //工事開始
        active[idx] = true;
        que.push(idx);
      }
    }
  }
  return 0;
}

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

struct ppp{ll l,r,v,tag;}tree[4000005];

struct ttt{ll s,t,x;}b[200005];

bool cmp(ttt l,ttt r){return l.x>r.x;}

ll p[200005];

set<ll> k;

vector<ll> a;

void push(ll i){

    tree[i*2].tag=tree[i].tag;

	tree[i*2+1].tag=tree[i].tag;

	tree[i*2].v=(tree[i*2].r-tree[i*2].l+1)*tree[i*2].tag;

	tree[i*2+1].v=(tree[i*2+1].r-tree[i*2+1].l+1)*tree[i*2+1].tag;

	tree[i].tag=0;

}

void buildtree(ll i,ll l,ll r){

	tree[i].l=l;tree[i].r=r;

	if(l==r){

		tree[i].v=-1;

		return;

	}

	buildtree(i*2,l,(l+r)/2);

	buildtree(i*2+1,(r+l)/2+1,r);

	tree[i].v=tree[i*2].v+tree[i*2+1].v;

}

void update(ll i,ll l,ll r,ll k){

    if(tree[i].l>=l&&tree[i].r<=r){

        tree[i].tag=k;

		tree[i].v=(tree[i].r-tree[i].l+1)*k;

        return ;

    }

    if(tree[i].tag) push(i);

    ll m=(tree[i].l+tree[i].r)/2;

    if(l<=m) update(i*2,l,r,k);

    if(r>m) update(i*2+1,l,r,k);

    tree[i].v=tree[i*2].v+tree[i*2+1].v;

}

ll query(ll i,ll l,ll r){

    if(tree[i].l>=l&&tree[i].r<=r){

        return tree[i].v;

    }

    if(tree[i].tag) push(i);

    ll m=(tree[i].r+tree[i].l)/2,ans=0;

    if(l<=m) ans+=query(i*2,l,r);

    if(r>m) ans+=query(i*2+1,l,r);

    return ans;

}

int main(){

	ll n,q;

	cin>>n>>q;

	a.push_back(-1e9);

	for(ll i=1;i<=n;i++){

		cin>>b[i].s>>b[i].t>>b[i].x;

		k.insert(max(b[i].s-b[i].x,(ll)0));

		k.insert(max(b[i].t-1-b[i].x,(ll)0));

	}

	for(ll i=1;i<=q;i++){

		cin>>p[i];k.insert(p[i]);

	}

	for(auto x:k){

		a.push_back(x);

	}

	buildtree(1,1,a.size());

	sort(b+1,b+1+n,cmp);

	for(ll i=1;i<=n;i++){

		ll l=lower_bound(a.begin(),a.end(),max((ll)0,b[i].s-b[i].x))-a.begin();

		ll r=lower_bound(a.begin(),a.end(),max((ll)0,b[i].t-b[i].x-1))-a.begin();

		update(1,l,r,b[i].x);

	}

	for(ll i=1;i<=q;i++){

		ll l=lower_bound(a.begin(),a.end(),p[i])-a.begin();

		cout<<query(1,l,l)<<endl;

	}

}