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

int main(void){
  const int inf = 1 << 30;
  typedef tuple<int, int, int> t3;
  int n, Q;
  priority_queue<t3, vector<t3>, greater<t3>> q;
  cin >> n >> Q;
  vector<int> ans(Q, -1), ds(Q);
  // multiset<int> ms; ms.insert(inf);
  set<int> ms; ms.insert(inf);
  for (int i = 0; i < n; i++){
    int s, t, x;
    scanf("%d %d %d", &s, &t, &x);
    q.push(make_tuple(s - x, x, 1));
    q.push(make_tuple(t - x, x, 0));
  }

  for (int i = 0; i < Q; i++) scanf("%d", &ds[i]);

  int cur = 0;
  while (!q.empty()){
    t3 e = q.top(); q.pop();
    int t, x, act, v;
    tie(t, x, act) = e; v = *ms.begin();
    while (cur < Q && ds[cur] < t)
      ans[cur++] = v;
    
    if (act) ms.insert(x);
    else ms.erase(x);
    // else ms.erase(ms.find(x));
  }

  for (int i = 0; i < Q; i++) printf("%d\n", ans[i] == inf ? -1 : ans[i]);
  return 0;
}
