#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <numeric>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline bool Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+" ";
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e17;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 200005;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,q;
    cin >> n >> q;
    set<ll> num;
    vector<vector<ll>> event;
    ll s,t,x;
    rep(i,n){
        cin >> s >> t >> x;
        vector<ll> a1{s-x,1,x},a2{t-x,-1,x};
        event.push_back(a1);
        event.push_back(a2);
    }
    SORT(event);
    vector<ll> d(q);
    ll index = 0;
    cins(all(d));
    rep(i,2*n){
        while(d[index] < event[i][0] && index < q){
            if (num.empty()) PRINT(-1);
            else PRINT(*num.begin());
            index++;
        }
        if (index == q) break;
        if (event[i][1] == 1) num.insert(event[i][2]);
        if (event[i][1] == -1) num.erase(event[i][2]);
    }
    rep(_,index,q) PRINT(-1);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#ifndef ONLINE_JUDGE
	#define W(x, y) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << y;
#else
	#define W(x, y)
#endif

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<pii>;
using vl = vector<ll>;
using vll = vector<pll>;
using ld = long double;
#define ff first
#define ss second
const ld pi = acosl(-1);
const ll prime = 1000000000 + 7;
const ll INF = 1000000000;

struct UnionFind{
    vl pai;
    vl rank;
    vl sum;
    UnionFind(ll n): pai(n), rank(n), sum(n){
        iota(pai.begin(), pai.end(), 0);
        fill(rank.begin(), rank.end(), 1);
        fill(sum.begin(), sum.end(), 1);
    }
    ll Find(ll x){
        if(x == pai[x]){
            return x;
        }
        return pai[x] = Find(pai[x]);
    }
    void Union(ll a, ll b){
        a = Find(a);
        b = Find(b);
        if(a == b){
            return;
        }
        if(rank[a] == rank[b]){
            rank[a]++;
        }
        if(rank[a] < rank[b]){
            sum[b] += sum[a];
            pai[a] = b;
        } else{
            sum[a] += sum[b];
            pai[b] = a;
        }
    }
};

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

    ll n, q;
    while(cin >> n >> q){
        vector<tuple<ll, ll, ll>> vet(n);
        map<ll, ll> conj;
        vl res(q, -1);
        for(int i = 0; i < n; ++i){
            ll s, t, x;
            cin >> s >> t >> x;
            vet[i] = make_tuple(x, s, t);
        }
        sort(vet.begin(), vet.end(), [](tuple<ll, ll, ll>a, tuple<ll, ll, ll>b){
            ll as, at, ax;
            tie(ax, as, at) = a;
            ll bs, bt, bx;
            tie(bx, bs, bt) = b;
            if(ax == bx){
                return as < bs;
            }
            return ax < bx;
        });
        for(int i = 0; i < q; ++i){
            ll d;
            cin >> d;
            conj[d] = i;
        }
        vector<ll> aux;
        for(int i = 0; i < n; ++i){
            ll s, t, x;
            tie(x, s, t) = vet[i];
            auto it1 = conj.lower_bound(s-x);
            if(it1 != conj.end()){
                
            }
            auto it2 = conj.lower_bound(t-x);
            if(it2 != conj.begin()){
                it2;
            }
            for(; it1 != it2; ++it1){
                res[it1->ss] = x;
                aux.push_back(it1->ff);
            }
            while(aux.size()){
                conj.erase(aux.back());
                aux.pop_back();
            }
        }

        for(int i = 0; i < q; ++i){
            cout << res[i] << endl;
        }
    }

    
    return 0;
}