#include <bits/stdc++.h>
using namespace std;
constexpr int INF = std::numeric_limits<int>::max();
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, Q;
  cin >> N >> Q;
  vector<tuple<int, int, int>> E;
  for (int i = 0; i < N; i++) {
    int s, t, x;
    cin >> s >> t >> x;
    E.emplace_back(s - x, 1, x);
    E.emplace_back(t - x, -1, x);
  }
  sort(E.begin(), E.end());
  vector<int> D(Q);
  vector<int> ANS(Q);
  set<int> set;
  for (int &d : D) {
    cin >> d;
  }
  int i = 0;
  for (auto &tuple : E) {
    int t = get<0>(tuple);
    int s = get<1>(tuple);
    int x = get<2>(tuple);
    while (D[i] < t && i < Q) {
      if (set.empty()) {
        ANS[i] = -1;
      } else {
        ANS[i] = *set.begin();
      }
      i++;
    }
    if (s == 1) {
      set.insert(x);
    } else {
      set.erase(x);
    }
  }
  while (i < Q) {
    if (set.empty()) {
      ANS[i] = -1;
    } else {
      ANS[i] = *set.begin();
    }
    i++;
  }
  for (auto ans : ANS) {
    cout << ans << endl;
  }
}
