#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll INF = ll(1e18)+1;
int main(){
    ll n, q;
    cin >> n >> q;
    vector<vector<ll>> xst;
    rep(i, n){
        ll s, t, x;
        cin >> s >> t >> x;
        xst.push_back({x,s,t});
    }
    sort(xst.begin(), xst.end());
    set<P> s;
    rep(i, q){
        ll d;
        cin >> d;
        s.insert(P(d, i));
    }
    vector<ll> ans(q, -1);
    for(auto i:xst){
        int x, l, r;
        x = i[0]; l = i[1]-x; r = i[2]-x;
        auto it = s.lower_bound(P(l, -1));
        while(it != s.end()){
            if(it->first >= r)break;
            else{
                ans[it->second] = x;
                s.erase(it++);
            }
        }
    }
    rep(i, q){
        cout << ans[i] << endl;
    }
    return 0;
}