#include <bits/stdc++.h>
using namespace std;
struct roadwork {
  long long X;
  int type;
  long long T;
};
int main(int argc, char** argv) {
  int N, Q;
  cin >> N >> Q;
  vector<roadwork> rw(2 * N);
  vector<long long> p(Q);
  for (int i = 0; i < N; i++) {
    long long s, t, x;
    cin >> s >> t >> x;
    rw[2 * i + 0].T = s - x;
    rw[2 * i + 0].type = 1;
    rw[2 * i + 0].X = x;
    rw[2 * i + 1].T = t - x;
    rw[2 * i + 1].type = -1;
    rw[2 * i + 1].X = x;
  }
  sort(rw.begin(), rw.end(),
       [](const roadwork& x, const roadwork& y) { return x.T < y.T; });
  for (int i = 0; i < Q; i++) {
    cin >> p[i];
  }
  multiset<long long> now_working;
  int j = 0;
  for (int i = 0; i < Q; i++) {
    while (j < rw.size() && p[i] >= rw[j].T) {
      if (rw[j].type == 1) {
        now_working.insert(rw[j].X);
      } else {
        now_working.erase(rw[j].X);
      }
      j++;
    }
    if (now_working.empty()) {
      cout << -1 << endl;
    } else {
      cout << *now_working.begin() << endl;
    }
  }
}
