#include<bits/stdc++.h>
using namespace std;
#define int long long

#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif

template <class T>
struct DelaySegmentTree{
  using F = function<T(T,T)>;
  F f;
  T inf;
  int n;
  vector<int> node,delay_val,delay_add;
  vector<bool> delayflag;

  DelaySegmentTree(vector<T> v,T inf,F f):inf(inf),f(f){
    n = 1; while(n < v.size()) n *= 2;
    node.resize(2*n-1,inf);
    delay_val.resize(2*n-1,inf);
    delay_add.resize(2*n-1,0);
    delayflag.resize(2*n-1,false);
    for(int i = 0; i < v.size(); i++) node[i+n-1] = v[i];
    for(int i = n-2; i >= 0; i--) node[i] = f(node[2*i+1],node[2*i+2]);
  }

  void eval(int k,int l,int r){
    if(delayflag[k]){
      node[k] = delay_val[k];
      if(r-l > 1){
        delay_val[2*k+1] = delay_val[2*k+2] = delay_val[k];
        delayflag[2*k+1] = delayflag[2*k+2] = true;
      }
      delayflag[k] = false;
    }
    if(delay_add[k] != 0){
      node[k] += delay_add[k];
      if(r-l > 1){
        delay_add[2*k+1] += delay_add[k] / 2;
        delay_add[2*k+2] += delay_add[k] / 2;
      }
      delay_add[k] = 0;
    }
  }

  void update(int a,int b,T x){ update(a,b,x,0,0,n); }
  void update(int a,int b,T x,int k,int l,int r){
    eval(k,l,r);
    if(b <= l || r <= a) return;
    if(a <= l && r <= b){
      delay_val[k] = x;
      delayflag[k] = true;
      eval(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] = f(node[2*k+1],node[2*k+2]);
    }
  }

  void add(int a,int b,T x){ add(a,b,x,0,0,n); }
  void add(int a,int b,T x,int k,int l,int r){
    eval(k,l,r);
    if(b <= l || r <= a) return;
    if(a <= l && r <= b){
      delay_add[k] += x * (r - l);
      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]);
    }
  }

  T getval(int a,int b){ return getval(a,b,0,0,n); }
  T getval(int a,int b,int k,int l,int r){
    //区間[a, b)の値を返す
    eval(k,l,r);
    if(b <= l || r <= a) return inf;
    if(a <= l && r <= b) return node[k];
    T vl = getval(a, b, 2*k+1, l, (l+r)/2);
    T vr = getval(a, b, 2*k+2, (l+r)/2, r);
    return f(vl, vr);
  }
};

const int INF = 1 << 30;

signed main(){

  int n,q; cin >> n >> q;
  vector<int> s(n),t(n),x(n);
  vector<int> v;
  v.push_back(0),v.push_back(INF);
  for(int i = 0; i < n; i++){
    cin >> s[i] >> t[i] >> x[i];
    v.push_back(s[i] - x[i]);
    v.push_back(t[i] - x[i]);
  }

  vector<int> order(n);
  for(int i = 0; i < n; i++) order[i] = i;
  sort(order.begin(),order.end(),[&](int i,int j){
    return x[i] > x[j];
  });
  sort(v.begin(),v.end());
  v.erase(unique(v.begin(),v.end()),v.end());
  DelaySegmentTree<int> seg(vector<int>(v.size()+1,INF),INF,[](int x,int y){
    return min(x,y);
  });
  for(int i = 0; i < n; i++){
    int pos = order[i];
    int l = lower_bound(v.begin(),v.end(),s[pos] - x[pos]) - v.begin();
    int r = lower_bound(v.begin(),v.end(),t[pos] - x[pos]) - v.begin();
    seg.update(l,r,x[pos]);
  }

  // for(int i = 0; i < v.size()+1; i++){
  //   cout << seg.getval(i,i+1) << " ";
  // }
  // cout << endl;

  for(int i = 0; i < q; i++){
    int d; cin >> d;
    //int it = lower_bound(v.begin(),v.end(),d) - v.begin();
    int it = upper_bound(v.begin(),v.end(),d) - v.begin();
    it--;
    int res = seg.getval(it,it+1);
    if(res == INF) cout << -1 << endl;
    else cout << res << endl;
  }

  return 0;
}


Measured memory_bytes: 37484