#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>



using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)


















struct T{
    ll val,alive;
    T(ll val,ll alive):val(val),alive(alive){}
};
auto f=[](T a,T b){
    return T(min(a.val,b.val),a.alive|b.alive);
};
auto g=[](T a,ll b){
    return T(a.alive?min(a.val,b):a.val,a.alive);
};
auto h=[](ll a,ll b){return min(a,b);};


template <typename T,typename E>
struct SegmentTree{
  using F = function<T(T,T)>;
  using G = function<T(T,E)>;
  using H = function<E(E,E)>;
  ll n,height;
  F f;
  G g;
  H h;
  T ti;
  E ei;
  vector<T> dat;
  vector<E> laz;
  SegmentTree(F f,G g,H h,T ti,E ei):
    f(f),g(g),h(h),ti(ti),ei(ei){}
  
  void init(ll n_){
    n=1;height=0;
    while(n<n_) n<<=1,height++;
    dat.assign(2*n,ti);
    laz.assign(2*n,ei);
  }
  void build(const vector<T> &v){
    ll n_=v.size();
    init(n_);
    for(ll i=0;i<n_;i++) dat[n+i]=v[i];
    for(ll i=n-1;i;i--)
      dat[i]=f(dat[(i<<1)|0],dat[(i<<1)|1]);
  }
  inline T reflect(ll k){
    return laz[k]==ei?dat[k]:g(dat[k],laz[k]);
  }
  inline void eval(ll k){
    if(laz[k]==ei) return;
    laz[(k<<1)|0]=h(laz[(k<<1)|0],laz[k]);
    laz[(k<<1)|1]=h(laz[(k<<1)|1],laz[k]);
    dat[k]=reflect(k);
    laz[k]=ei;
  }
  inline void thrust(ll k){
    for(ll i=height;i;i--) eval(k>>i);
  }
  inline void recalc(ll k){    
    while(k>>=1)
      dat[k]=f(reflect((k<<1)|0),reflect((k<<1)|1));
  }
  void update(ll a,ll b,E x){
    thrust(a+=n);
    thrust(b+=n-1);
    for(ll l=a,r=b+1;l<r;l>>=1,r>>=1){
      if(l&1) laz[l]=h(laz[l],x),l++;
      if(r&1) --r,laz[r]=h(laz[r],x);
    }
    recalc(a);
    recalc(b);
  }
  void set_val(ll a,T x){
    thrust(a+=n);
    dat[a]=x;laz[a]=ei;
    recalc(a);
  }
  T query(ll a,ll b){
    thrust(a+=n);
    thrust(b+=n-1);
    T vl=ti,vr=ti;
    for(ll l=a,r=b+1;l<r;l>>=1,r>>=1) {
      if(l&1) vl=f(vl,reflect(l++));
      if(r&1) vr=f(reflect(--r),vr);
    }
    return f(vl,vr);
  }
};


int main(){    
    ll n, q;
    cin >> n >> q;
    
    vector<ll> s(n), t(n), x(n);
    REP(i, n){
        cin >> s[i] >> t[i] >> x[i];
    }
    vector<ll> d(q);
    REP(i, q){
        cin >> d[i];
    }
    
    T ti(INF, 0);
    ll ei = INF + 1;
    SegmentTree<T, ll> tree(f, g, h, ti, ei);
    tree.build(vector<T>(q, ti));
    REP(i, q){
        T tmp(INF, 1);
        tree.set_val(i, tmp);
    }
    
    REP(i, n){
        ll l1 = max(s[i] - x[i], 0LL), r1 = max(t[i] - x[i], 0LL);
        ll it1 = lower_bound(d.begin(), d.end(), l1) - d.begin();
        ll it2 = lower_bound(d.begin(), d.end(), r1) - d.begin();
        tree.update(it1, it2, x[i]);
    }
    
    REP(i, q){
        ll tmp = tree.query(i, i + 1).val;
        cout << ((tmp != INF)? tmp : -1) << endl;
    }
}

Measured memory_bytes: 21888