#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,m,n) for(int i=m;i<n;i++)
typedef pair<ll,int> P;

int main(){
  int n,q;
  cin>>n>>q;
  ll s[n],t[n],x[n];
  rep(i,0,n) cin>>s[i]>>t[i]>>x[i];
  ll d[q];
  rep(i,0,q) cin>>d[i];
  
  set<P> st;
  rep(i,0,q){
    st.insert(P(d[i],i));
  }
  
  ll ans[q];
  rep(i,0,q) ans[i]=-1;
  
  vector<ll> a[n];
  rep(i,0,n) a[i]={x[i],s[i],t[i]};
  sort(a,a+n);
  
  rep(i,0,n){
    auto it=st.lower_bound(P(a[i][1]-a[i][0],-1));
    while(it!=st.end()){
      if(it->first>=a[i][2]-a[i][0]) break;
      ans[it->second]=a[i][0];
      st.erase(it++);
    }
  }
  rep(i,0,q) cout<<ans[i]<<endl;
}