#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);++i)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const int MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  int n,q;
  cin >> n >> q;
  vector<tuple<int,int,int>> stx(n);
  rep(i,n){
    cin >> get<1>(stx[i]) >> get<2>(stx[i]) >> get<0>(stx[i]);
  }
  sort(stx.begin(),stx.end());
  
  set<P> st;
  rep(i,q){
    int x;
    cin >> x;
    st.emplace(x,i);
  }
  
  vector<int> ans(q,-1);
  rep(i,n){
    int s = get<1>(stx[i]);
    int t = get<2>(stx[i]);
    int x = get<0>(stx[i]);
    //xの昇順で考えてぶつかったら，その人をerase
    auto first = st.lower_bound(P(s-x,0));//引っかかる人
    auto end = st.upper_bound(P(t-x-1,q));//引っかからない人
    
    for(auto it = first; it !=end; ++it) ans[it->second] = x;
    
    st.erase(first,end);
  }
  
  rep(i,q) cout << ans[i] << endl;
  return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1<<(n))
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
int const INF = 1001001001;


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

int N,Q;
cin >> N >> Q;

map<int,vi> add;
map<int,vi> era;
map<int,int> mp;

rep(i,N) {
    int s,t,x;
    cin >> s >> t >> x;
    add[max(0,s-x)].push_back(x);
    era[max(1,t-x)].push_back(x);
    mp[max(0,s-x)] = 0;
    mp[max(1,t-x)] = 0;
}
rep(i,Q) {
    int d;
    cin >> d;
    mp[d] = 1;
}

set<int> st;

for(auto x : mp) {

    for(auto erx : era[x.first]) {
        st.erase(erx);
    }
    for(auto adx : add[x.first]) {
        st.insert(adx);
    }
    if(x.second == 1) {
        if(!st.empty()) {
            cout << *st.begin() << endl;
        }
        else {
            cout << -1 << endl;
        }
    }
}

return 0;
}