#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  long long int N, Q;
  long long int s, t, x;
  vector<tuple<long long int, long long int, long long int>> L;
  long long int d;
  set<tuple<long long int, long long int>> D;
  cin >> N >> Q;
  for (long long int i = 0; i < N; i++) {
    cin >> s >> t >> x;
    L.emplace_back(s - x, t - x, x);
  }
  for (long long int i = 0; i < Q; i++) {
    cin >> d;
    D.insert(make_tuple(d, i));
  }
  sort(L.begin(), L.end(),
       [](tuple<long long int, long long int, long long int> left,
          tuple<long long int, long long int, long long int> right) {
         return get<2>(left) <= get<2>(right);
       });
  vector<long long int> DD(Q, -1L);
  for (auto l : L) {
    long long int s, t, x;
    tie(s, t, x) = l;
    auto it = D.lower_bound(make_tuple(s, -1));
    while (it != D.cend()) {
      long long int d = get<0>(*it);
      long long int idx = get<1>(*it);
      if (d >= t) {
        break;
      }
      DD[idx] = x;
      D.erase(it++);
    }
  }
  for (auto d : DD) {
    cout << d << endl;
  }
  return 0;
}
