#include <iostream>
#include <algorithm>
#include <tuple>
#include <set>

using namespace std;

#define rep(i,n) for(int i=0; i<(int)(n); i++)

int main() {
  int n, q, c = (int)1e9+7;
  cin >> n >> q;
  tuple<int, int> a[2*n+q];
  rep(i,n) {
    int s, t, x;
    cin >> s >> t >> x;
    a[2*i]   = tuple<int, int> (s - x, x);
    a[2*i+1] = tuple<int, int> (t - x, x);
  }
  rep(i,q) {
    int d;
    cin >> d;
    a[2*n+i] = tuple<int, int> (d, c);
  }
  
  sort(a, a+2*n+q);
  
  int r[q], j = 0;
  set<int> s = {c};
  rep(i,2*n+q) {
    int k = get<1>(a[i]);
    if(k == c) {
      r[j] = *s.begin();
      if(r[j] == c) r[j] = -1;
      j++;
    } else {
      if(s.count(k)) s.erase(k);
      else s.insert(k);
    }
  }
  
  rep(i,q) cout << r[i] << endl;
  return 0;
}