#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using  namespace std;
typedef long long ll;

struct Plan {
  int s, t, x;
  bool operator < (const Plan &p) const {
    return x < p.x;
  }
};

int main() {
  int n, q;
  cin >> n >> q;
  Plan p[n];
  rep(i, n) cin >> p[i].s >> p[i].t >> p[i].x;
  sort(p, p+n);

  int d[q];
  for (int i = q-1; i >= 0; --i) cin >> d[i];
  rep(i, q) d[i] *= -1;

  set<int> sets;
  rep(i, q) sets.insert(i);
  int ans[q];
  rep(i, q) ans[i] = 0;
  
  rep(i, n) {
    int l = distance(d, upper_bound(d, d+q, p[i].x-p[i].t));
    int r = distance(d, upper_bound(d, d+q, p[i].x-p[i].s));
    auto itrl = sets.lower_bound(l);
    auto itrr = sets.lower_bound(r);
    while (itrl != itrr) {
      ans[*itrl] = p[i].x;
      itrl = sets.erase(itrl);
    }
  }

  for (int i = q-1; i >= 0; --i) {
    cout << (ans[i] ? ans[i] : -1) << endl;
  }
  return 0;
}