#include <bits/stdc++.h>
using namespace std;

#define stx tuple<int, int, int>
#define xt pair<int, int>

int main() {
  int N, Q;
  cin >> N >> Q;
  priority_queue<stx, vector<stx>, greater<stx>> STX;
  int S, T, X, D[Q];
  for (int i = 0; i < N; i++) {
    cin >> S >> T >> X;
    STX.push(stx(S - X, T - X, X));
  }
  for (int i = 0; i < Q; i++) {
    cin >> D[i];
  }

  priority_queue<xt, vector<xt>, greater<xt>> XT;
  for (int i = 0; i < Q; i++) {
    while (!STX.empty() && get<0>(STX.top()) <= D[i]) {
      XT.push({get<2>(STX.top()), get<1>(STX.top())});
      STX.pop();
    }

    while (!XT.empty() && XT.top().second <= D[i]) XT.pop();

    if (XT.empty())
      cout << -1 << endl;
    else
      cout << XT.top().first << endl;
  }

  return 0;
}
