#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;

#define rep(i,m,n) for(ll i=m;i<n;i++)

int main(){
   cin.tie(nullptr);
  ios::sync_with_stdio(false);

 ll n,q;
  cin >> n >> q;
  vector<tuple<ll,ll,ll>> v;
  set<ll> st;
  rep(i,0,n) {
   ll s,t,x;
    cin >> s >> t >> x;
    v.push_back(make_tuple(s-x,1,x));
    v.push_back(make_tuple(t-x,-1,x));
  }

   sort(v.begin(),v.end());
  
   ll index=0;
  rep(i,0,q){
   ll d;
    cin >> d;
    
     while(get<0>(v[index])<=d&&index<v.size()){
       if(get<1>(v[index])==1) st.insert(get<2>(v[index]));
       else st.erase(get<2>(v[index]));
       index++; 
     }
      if(!st.empty()) cout << *st.begin() << endl;
      else cout << -1 << endl;
  }

}
