#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>P;
priority_queue<P,vector<P>,greater<P> >p;
priority_queue<P,vector<P>,greater<P> >pq;

int main(){
  int n,q;
  int t[200009],x[200009];
  cin>>n>>q;
  for(int i=0;i<n;i++){
    int s;
    cin>>s>>t[i]>>x[i];
    t[i]-=x[i];
    p.push(P(s-x[i],i));
  }
  for(int i=0;i<q;i++){
    int d;
    cin>>d;
    while(!p.empty()){
      P now=p.top();
      int s=now.first;
      int idx=now.second;
      if(s>d)break;
      pq.push(P(x[idx],idx));
      p.pop();
    }
    while(!pq.empty()){
      P now=pq.top();
      int idx=now.second;
      if(t[idx]>d){
	cout<<x[idx]<<endl;
	break;
      }
      pq.pop();
    }
    if(pq.empty())cout<<-1<<endl;
  }
  return(0);
}
