#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<class monoid>
struct LazySegmentTree
{
  using F=function<monoid(monoid,monoid)>;
private:
    int n;
    vector<monoid> node, lazy;
    F f,g;
    monoid m1,m2;


public:
    LazySegmentTree(int sz,F fsum,monoid m1,F fadd,monoid mlazy):f(fsum),g(fadd),m1(m1),m2(mlazy)
    {
        n = 1; while(n < sz) n *= 2;
        node.resize(2*n-1,m1);
        lazy.resize(2*n-1,m2);
    }
    void eval(int k, int l, int r)
    {
      if(lazy[k] != m2)
      {
        node[k] =g(node[k],lazy[k]);//ここ
        if(r - l > 1)
        {
          lazy[2*k+1] = g(lazy[2*k+1],lazy[k]);//ここ
          lazy[2*k+2] = g(lazy[2*k+2],lazy[k]);//ここ
        }
        lazy[k] = m2;
      }
    }
    void add(int a,int b,monoid x)
    {
      add(a,b,x,0,0,n);
    }
    void add(int a, int b, monoid x, int k, int l, int r)
    {
      eval(k, l, r);
      if(b <= l || r <= a) return;
      if(a <= l && r <= b)
      {
          lazy[k] =g(lazy[k],x) ;//ここ
          eval(k, l, r);
      }
      else
      {
          add(a, b, x, 2*k+1, l, (l+r)/2);
          add(a, b, x, 2*k+2, (l+r)/2, r);
          node[k] = f(node[2*k+1],node[2*k+2]);
      }
    }
    monoid query(int a,int b)
    {
      return query(a,b,0,0,n);
    }
    monoid query(int a, int b, int k, int l, int r)
    {
      if(b <= l || r <= a) return m1;
      eval(k, l, r);
      if(a <= l && r <= b) return node[k];
      monoid vl = query(a, b, 2*k+1, l, (l+r)/2);
      monoid vr = query(a, b, 2*k+2, (l+r)/2, r);
      return f(vl,vr);
    }
};
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());
  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);},1e10,[](ll a,ll b){return min(a,b);},1e10);

  rep(i,n){
    lst.add(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<<endl;
  }

  return 0;

}


Measured memory_bytes: 50924