#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n-1); i >= 0; i--)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

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; }

typedef long long ll;

using namespace std;


template<typename Monoid ,typename OperatorMonoid=Monoid>
struct LazySegmentTree{
  using F=function<Monoid(Monoid,Monoid)>;
  using G=function<Monoid(Monoid,OperatorMonoid)>;
  using H=function<Monoid(OperatorMonoid,OperatorMonoid)>;
  int sz,height;
  vector<Monoid>data;
  vector<OperatorMonoid>lazy;
  const F f;
  const G g;
  const H h;
  const Monoid M1;
  const OperatorMonoid OM0;

  LazySegmentTree(int n,const F f,const G g,const H h,
                  const Monoid M1,const OperatorMonoid OM0)
    :f(f),g(g),h(h),M1(M1),OM0(OM0){
    sz=1;
    height=0;
    while(sz < n) sz <<= 1, height++;
    data.assign(2 * sz, M1);
    lazy.assign(2 * sz, OM0);
  }
  inline void propagate(int k){
    if(lazy[k]!=OM0){
      lazy[2*k+0]=h(lazy[2*k+0],lazy[k]);
      lazy[2*k+1]=h(lazy[2*k+1],lazy[k]);
      data[k]=reflect(k);
      lazy[k]=OM0;
    }
  }
  inline Monoid reflect(int k) {
    return lazy[k] == OM0 ? data[k] : g(data[k], lazy[k]);
  }
  inline void recalc(int k) {
    while(k >>= 1) data[k] = f(reflect(2 * k + 0), reflect(2 * k + 1));
  }
  inline void thrust(int k){
    for(int i=height;i>0;i--)propagate(k>>i);
  }
  void update(int a,int b,const OperatorMonoid &x){
    thrust(a+=sz);
    thrust(b+=sz-1);
    for(int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
      if(l & 1) lazy[l] = h(lazy[l], x), ++l;
      if(r & 1) --r, lazy[r] = h(lazy[r], x);
    }
    recalc(a);
    recalc(b);
  }
  Monoid query(int a, int b) {
    thrust(a += sz);
    thrust(b += sz - 1);
    Monoid L = M1, R = M1;
    for(int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
      if(l & 1) L = f(L, reflect(l++));
      if(r & 1) R = f(reflect(--r), R);
    }
    return f(L, R);
  }
  Monoid operator[](const int &k) {
    return query(k, k + 1);
  }
};

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,q;cin>>n>>q;
  struct kou{
    ll s,t,x;
    bool in(ll num){
      if(s<=num&&num<t)return 1;
      return 0;
    }
  };
  vector<kou>ks(n);
  vector<ll>za;
  rep(i,n){
    cin>>ks[i].s>>ks[i].t>>ks[i].x;
    ks[i].s-=ks[i].x;
    ks[i].t-=ks[i].x;
    za.push_back(ks[i].s);
    za.push_back(ks[i].t);
  }
  za.push_back(1e9+7);
  sort(all(za));
  za.erase(unique(all(za)),za.end());
  unordered_map<ll,ll>ma;
  ll id=0;
  rep(i,za.size()){
    ma[za[i]]=id++;
  }
  LazySegmentTree<ll>lst(id,[](ll a,ll b){return min(a,b);},
                            [](ll a,ll b){return min(a,b);},
                            [](ll a,ll b){return min(a,b);},
                            1e10,1e10);

  rep(i,n){
    lst.update(ma[ks[i].s],ma[ks[i].t],ks[i].x);
    //cout<<"add "<<ma[ks[i].s]<<" "<<ma[ks[i].t]<<" "<<ks[i].x<<endl;
  }
  rep(i,q){
    ll d;cin>>d;
    ll td=upper_bound(all(za),d)-za.begin();
    ll res;
    td--;
    res=lst.query(td,td+1);
    if(res==1e10)res=-1;
    cout<<res<<"\n";
  }
  cout<<flush;

  return 0;

}


Measured memory_bytes: 42604