#include <bits/stdc++.h>
using namespace std;
int N, Q, S, T, X, D;
set<pair<int, pair<int, int>>> events;
set<pair<int, int>> sweep;
vector<int> ans;
int main() {
  cin >> N >> Q;
  for (int i = 0; i < (int)N; i++) {
    cin >> S >> T >> X;
    events.insert({X, {S, T}});
  }
  for (int i = 0; i < (int)Q; i++) {
    cin >> D;
    sweep.insert({D, i});
  }
  ans.assign(Q, -1);
  for (auto e : events) {
    if (sweep.empty()) break;
    X = e.first;
    S = e.second.first;
    T = e.second.second;
    set<pair<int, int>>::iterator it = sweep.begin();
    set<pair<int, int>>::iterator it1, it2;
    int i1, i2, j;
    i1 = 0;
    j = sweep.size();
    while (i1 < j) {
      int m = (i1 + j) >> 1;
      if (next(it, m)->first + X >= S)
        j = m;
      else
        i1 = m + 1;
    }
    it1 = next(it, i1);
    i2 = 0;
    j = sweep.size();
    while (i2 < j) {
      int m = (i2 + j) >> 1;
      if (next(it, m)->first + X >= T)
        j = m;
      else
        i2 = m + 1;
    }
    it2 = next(it, i2);
    for (set<pair<int, int>>::iterator it_ = it1; it_ != it2; it_++)
      ans[it_->second] = X;
    it2;
    sweep.erase(it1, it2);
  }
  for (int i = 0; i < (int)Q; i++) cout << ans[i] << '\n';
}
