#include <bits/stdc++.h>
using namespace std;
using type = pair<int, long long>;
using event = pair<long long, type>;
int main() {
  int N, Q;
  cin >> N >> Q;
  vector<event> v;
  for (int i = 0; i < N; ++i) {
    int s, t, x;
    cin >> s >> t >> x;
    v.push_back({s - x, type(-1, x)});
    v.push_back({t - x, type(0, x)});
  }
  for (int i = 0; i < Q; ++i) {
    int d;
    cin >> d;
    v.push_back({d, type(1, i)});
  }
  sort(v.begin(), v.end());
  vector<long long> res(Q);
  multiset<long long> se;
  for (auto p : v) {
    long long x = p.first;
    int type = p.second.first;
    long long val = p.second.second;
    if (type == -1)
      se.insert(val);
    else if (type == 0)
      se.erase(se.lower_bound(val));
    else
      res[val] = (se.empty() ? -1 : *(se.begin()));
  }
  for (auto v : res) cout << v << endl;
}
