#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
inline int read() {
  int x = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return w == 1 ? x : -x;
}
int n, q, d[200005], nxt[200005], ans[200005], pre[200005];
struct node {
  int s, t, x;
} p[200005];
struct node2 {
  int x, id;
};
set<int> s, tmp;
set<int>::iterator it1, it2;
map<int, int> mp;
vector<int> vec;
inline bool cmp(node a, node b) { return a.x < b.x; }
int main() {
  n = read();
  q = read();
  for (int i = 1; i <= n; i++)
    p[i].s = read(), p[i].t = read() - 1, p[i].x = read();
  sort(p + 1, p + n + 1, cmp);
  for (int i = 1; i <= q; i++)
    d[i] = read(), ans[i] = -1, s.insert(d[i]), mp[d[i]] = i, tmp.insert(d[i]);
  sort(d + 1, d + q + 1);
  for (int i = 1; i <= n; i++) {
    vec.clear();
    it1 = s.lower_bound(max(0, p[i].s - p[i].x));
    it2 = s.upper_bound(max(0, p[i].t - p[i].x));
    for (set<int>::iterator it = it1; it != it2; it++) {
      ans[mp[*it]] = p[i].x;
      vec.push_back(*it);
    }
    for (int i = 0; i < vec.size(); i++) s.erase(vec[i]);
  }
  for (int i = 1; i <= q; i++) printf("%d\n", ans[i]);
  return 0;
}
