#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
typedef long long ll;
using namespace std;

typedef pair<ll, ll> P;
#define fs first
#define sc second

const ll INF = 1LL << 40;

bool cmp(const pair<P, ll> &a, const pair<P, ll> &b){
  return a.sc > b.sc;
}

class LazySegmentTree{
public:
  int N;
  vector<ll> node, lazy;

  //コンストラクタ
  LazySegmentTree(vector<ll> v){
    int sz = v.size();
    N = 1;
    while(N < sz) N *= 2;
    node.resize(2 * N - 1, INF);
    lazy.resize(2 * N - 1, INF);

    for(int i = 0; i < sz; i++){
      int k = i + N - 1;
      node[k] = v[i];
      while(k > 0){
        k = (k - 1) / 2;
        node[k] = min(node[k * 2 + 1], node[k * 2 + 2]);
      }
    }
  }

  // [a, b)をcに変更
  void update(int a, int b, ll c){
    Update(a, b, c, 0, 0, N);
  }

  void Update(int a, int b, ll c, int k, int l, int r){
    eval(k, l, r);
    if(r <= a || b <= l) return;
    if(a <= l && r <= b){
      lazy[k] = c;
      eval(k, l, r);
    }
    else {
      Update(a, b, c, 2 * k + 1, l, (l + r) / 2);
      Update(a, b, c, 2 * k + 2, (l + r) / 2, r);
      node[k] = min(node[2 * k + 1], node[2 * k + 2]);
    }
  }

  //[a,b)の最小値
  ll query(int a, int b){
    return Query(a, b, 0, 0, N);
  }

  ll Query(int a, int b, int k, int l, int r){
    eval(k, l, r);
    if(r <= a || b <= l) return INF;
    if(a <= l && r <= b) return node[k];
    else{
      ll v1 = Query(a, b, k * 2 + 1, l, (l + r) / 2);
      ll v2 = Query(a, b, k * 2 + 2, (l + r) / 2, r);
      return min(v1, v2);
    }
  }

  //k番目のノードに遅延評価
  void eval(int k, int l, int r){
    if(lazy[k] != INF){
      node[k] = lazy[k];

      //最下段でないなら
      if(r - l > 1){
        lazy[2 * k + 1] = lazy[k];
        lazy[2 * k + 2] = lazy[k];
      }

      //自ノードの遅延配列を0に
      lazy[k] = INF;
    }
  }

  void print(){
    for(int i = 0; i < 2 * N - 1; i++){
      cout << "node[" << i << "] " << node[i] << "  " << lazy[i] << endl;
    }
  }
};

int main(){
  int N, Q;
  cin >> N >> Q;
  pair<P, ll> p[N];
  for(int i = 0; i < N; i++){
    cin >> p[i].fs.fs >> p[i].fs.sc >> p[i].sc;
  }
  ll D[Q];
  for(int i = 0; i < Q; i++) cin >> D[i];

  //xの降順にソート
  sort(p, p + N, cmp);
  /*for(int i = 0; i < N; i++){
    cout << p[i].fs.sc << " " << p[i].fs.sc << " " << p[i].sc << endl;
  }*/

  set<ll> st;
  for(int i = 0; i < N; i++){
    p[i].fs.fs -= p[i].sc;
    p[i].fs.sc -= p[i].sc + 1;
    st.insert(p[i].fs.fs);
    st.insert(p[i].fs.sc);
  }
  for(int i = 0; i < Q; i++){
    st.insert(D[i]);
  }

  /*for(auto it = st.begin(); it != st.end(); it++){
    cout << *it << " ";
  }
  cout << endl;*/

  int sz = st.size();
  vector<ll> vec(sz, INF);
  unordered_map<ll, int> mp; //時間からベクトルのインデックスへ
  int ind = 0;
  for(auto it = st.begin(); it != st.end(); it++){
    mp[*it] = ind;
    ind++;
  }

  LazySegmentTree sg = LazySegmentTree(vec);
  for(int i = 0; i < N; i++){
    int s = mp[p[i].fs.fs];
    int t = mp[p[i].fs.sc];
    //cout << s << " " << t << endl;
    sg.update(s, t + 1, p[i].sc);
  }

  for(int i = 0; i < Q; i++){
    ll res = sg.query(mp[D[i]], mp[D[i]] + 1);
    if(res == INF) cout << -1 << endl;
    else cout << res << endl;
  }

  return 0;
}


Measured memory_bytes: 103696