#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int Q, N, tmp;
  cin >> N >> Q;
  vector<long> S(N), T(N), X(N), D(Q), Cnt(Q, -1);
  for (int i = 0; i < N; ++i) {
    cin >> S[i] >> T[i] >> X[i];
  }
  for (int i = 0; i < Q; ++i) {
    cin >> D[i];
  }
  for (int i = 0; i < Q; ++i) {
    for (int j = 0; j < N; ++j) {
      long judge = X[j] + D[i];
      if (judge < T[j] && judge >= S[j]) {
        if (Cnt[i] > X[j] || Cnt[i] == -1) Cnt[i] = X[j];
      }
    }
  }
  for (int i = 0; i < Q; ++i) {
    cout << Cnt[i] << endl;
  }
  return 0;
}
