#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
template <class T>
ostream &operator<<(ostream &os, vector<T> const &vec) {
  if (vec.empty()) {
    os << "{}";
  } else {
    os << '{';
    for (size_t i = 0; i < vec.size() - 1; i++) os << vec[i] << ", ";
    os << vec.back() << '}';
  }
  return os;
}
template <class T, size_t S>
ostream &operator<<(ostream &os, array<T, S> const &arr) {
  if (arr.empty()) {
    os << "{}";
  } else {
    os << '{';
    for (size_t i = 0; i < arr.size() - 1; i++) os << arr[i] << ", ";
    os << arr.back() << '}';
  }
  return os;
}
template <class T, class U>
ostream &operator<<(ostream &os, pair<T, U> const &p) {
  os << '(' << p.first << ", " << p.second << ')';
  return os;
}
namespace math {
ll gcd(ll u, ll v) {
  while (v != 0) {
    ll r = u % v;
    u = v;
    v = r;
  }
  return u;
}
ll lcm(ll m, ll n) {
  if ((0 == m) || (0 == n)) return 0;
  return ((m / math::gcd(m, n)) * n);
}
}  // namespace math
struct UnionFind {
  vector<ll> data;
  UnionFind(ll size) : data(size, -1) {}
  bool unionSet(ll x, ll y) {
    x = root(x);
    y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y];
      data[y] = x;
    }
    return x != y;
  }
  bool findSet(ll x, ll y) { return root(x) == root(y); }
  ll root(ll x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
  ll size(ll x) { return -data[root(x)]; }
};
template <class T, class U>
pair<T, U> operator+(pair<T, U> const &a, pair<T, U> const &b) {
  return pair<T, U>(a.first + b.first, a.second + b.second);
}
template <class T, class U>
pair<T, U> operator-(pair<T, U> const &a, pair<T, U> const &b) {
  return pair<T, U>(a.first - b.first, a.second - b.second);
}
ll bound(function<bool(ll)> f, ll ng, ll ok) {
  while (abs(ng - ok) > 1) {
    ll mid = (ng + ok) / 2;
    if (f(mid))
      ok = mid;
    else
      ng = mid;
  }
  return ok;
}
template <class T, size_t s>
class tuple_comp {
 public:
  bool operator()(T const &a, T const &b) { return get<s>(a) < get<s>(b); }
};
int main(void) {
  ll N, Q;
  cin >> N >> Q;
  vector<pair<ll, pair<ll, ll>>> STX(N);
  for (ll i = 0; i < (N); i++) {
    cin >> STX[i].second.first;
    cin >> STX[i].second.second;
    cin >> STX[i].first;
    STX[i].first *= 2;
    STX[i].second.first *= 2;
    STX[i].second.second *= 2;
    STX[i].second.first -= 1;
    STX[i].second.second -= 1;
  }
  sort(STX.begin(), STX.end());
  set<pair<ll, ll>> D;
  vector<pair<ll, ll>> temp(Q);
  for (ll i = 0; i < (Q); i++) {
    ll d;
    cin >> d;
    d *= 2;
    temp[i] = {d, i};
  }
  shuffle(temp.begin(), temp.end(), mt19937());
  for (auto val : temp) D.insert(val);
  vector<ll> ans(Q, -2);
  for (ll i = 0; i < (N); i++) {
    ll const x = STX[i].first;
    ll const s = STX[i].second.first;
    ll const t = STX[i].second.second;
    pair<ll, ll> const l = {s - x, 0};
    pair<ll, ll> const r = {t - x, 0};
    auto const lb = D.lower_bound(l);
    auto const ub = D.upper_bound(r);
    for (auto ite = lb; ite != ub; ite++) ans[ite->second] = x;
    D.erase(lb, ub);
  }
  for (ll i = 0; i < (Q); i++) cout << ans[i] / 2 << endl;
  return 0;
}
