#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
const ll mod = 1000000007;

const ll LINF = 1e13;
const ll LLINF = 1e18;
const ll ALPHABET = 26;

template <class T>
void Swap(T& r, T& l) {
  T tmp = r;
  r = l;
  l = tmp;
}

template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x; //for(int i=0; i<vec.size(); i++) is >> x[i]; とかでもいい
  return is;
}



// check
// 問題文を復唱する

template<typename T>
bool greatertuple(tuple<ll, ll, ll> &l, tuple<ll, ll, ll>&r) {
  return get<1>(l) < get<1>(r);
}




struct LazySegmentTree {
public:
    ll n;
    vector<ll> node, lazy;
    vector<bool> lazyFlag;
    LazySegmentTree(vector<ll> v) {
        ll sz = (ll)v.size();
        n = 1; while(n < sz) n *= 2;
        node.resize(2*n-1);
        lazy.resize(2*n-1, LINF);
        lazyFlag.resize(2*n-1, false);
 
        for(ll i=0; i<sz; i++) node[i+n-1] = v[i];
        for(ll i=n-2; i>=0; i--) node[i] = min(node[i*2+1], node[i*2+2]);
    }
 
    void lazyEvaluate(ll k, ll l, ll r) {
        if(lazyFlag[k]) {
            node[k] = lazy[k];
            if(r - l > 1) {
                lazy[k*2+1] = lazy[k*2+2] = lazy[k];
                lazyFlag[k*2+1] = lazyFlag[k*2+2] = true;
            }
            lazyFlag[k] = false;
        }
    }
 
    void update(ll a, ll b, ll x, ll k=0, ll l=0, ll r=-1) {
        if(r < 0) r = n;
        lazyEvaluate(k, l, r);
        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[k] = x;
            lazyFlag[k] = true;
            lazyEvaluate(k, l, r);
        }
        else {
            update(a, b, x, 2*k+1, l, (l+r)/2);
            update(a, b, x, 2*k+2, (l+r)/2, r);
            node[k] = min(node[2*k+1], node[2*k+2]);
        }
    }
 
    ll find(ll a, ll b, ll k=0, ll l=0, ll r=-1) {
        if(r < 0) r = n;
        lazyEvaluate(k, l, r);
        if(b <= l || r <= a) return LINF;
        if(a <= l && r <= b) return node[k];
        ll vl = find(a, b, 2*k+1, l, (l+r)/2);
        ll vr = find(a, b, 2*k+2, (l+r)/2, r);
        return min(vl, vr);
    }
};


int main() {
  ll n, q;
  cin >> n >> q;


  vector<ll> s(n, 0);
  vector<ll> t(n, 0);
  vector<ll> x(n, 0);
  vector<ll> d(q, 0);

  vector<pair<ll, ll>> dp(q);


  for (int i = 0; i < n; i++) {
    cin >> s[i] >> t[i] >> x[i];
  }
  cin >> d;

  for (int i = 0; i < q; i++) {
    dp[i] = make_pair(d[i], LINF);
  }

  sort(d.begin(), d.end());

  //dをソート
  //まずs-tを スタートの範囲に変換する

  // 近い順に条件をソート? だめ
  //stの早い順にソート

  vector<tuple<ll, ll, ll>> start_endTime_s_t_x(n);

  for (int i = 0; i < n; i++) {
    start_endTime_s_t_x[i] = make_tuple(s[i] - x[i], t[i] - x[i] , x[i]);
  }


  sort(start_endTime_s_t_x.begin(), start_endTime_s_t_x.end(), [](tuple<ll, ll, ll> &l, tuple<ll, ll, ll>&r) {
    return get<2>(l) < get<2>(r);
  });


  ll ans = 0;



  // multiset < tuple<ll, ll, ll>,greatertuple<tuple<ll, ll, ll> > mset;

  ll validstart = -1;
  ll rightpos = n;
  vector<ll> tmp;


  vector<tuple<ll, ll, ll>> gg;

  for (int i = 0; i < n; i++) {//xが近い順に決めていく
    ll left = get<0>(start_endTime_s_t_x[i]);
    ll right = get<1>(start_endTime_s_t_x[i]);
    ll x2 = get<2>(start_endTime_s_t_x[i]);


    //dの中で、left以上のもののイテレータを返す
    auto Iter1 = lower_bound(d.begin(), d.end(), left);
    ll id_left = distance(d.begin(), Iter1);

    //dの中で、right以上のイテレータを返す
    auto Iter2 = lower_bound(d.begin(), d.end(), right);
    ll id_right = distance(d.begin(), Iter2);
    id_right--;

    gg.push_back(make_tuple(id_left, id_right, x2));


  }


  sort(gg.begin(), gg.end(), [](tuple<ll, ll, ll> &l, tuple<ll, ll, ll>&r) {
    return get<2>(l) > get<2>(r);
  });





  LazySegmentTree seg( vector<ll>(q, LINF) );

  for (int i = 0; i < n; i++) {
    ll id_left = get<0>(gg[i]);
    ll id_right = get<1>(gg[i]);
    ll x2 = get<2>(gg[i]);

    cerr << id_left << " - 区間 - " << id_right << " pos  " << x2 <<endl;
    seg.update(id_left,id_right+1,x2);
  }



  for (int i = 0; i < q; i++) {
    ans = -1;

    if (seg.find(i,i+1) != LINF) {
          ans = seg.find(i,i+1);
    }
    cout << ans << endl;
  }




}




















Measured memory_bytes: 31852