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

#define debug(x) cerr << "> " << #x << "\n" << x << endl;

template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {
  return s << "(" << p.first << ", " << p.second << ")";
}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i]; if (i < len - 1) s << "\t";
  }
  return s;
}
template<typename T> ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i] << endl;
  }
  return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const map<T1, T2>& m) {
  s << "{" << endl;
  for (auto itr = m.begin(); itr != m.end(); ++itr) {
    s << "\t" << (*itr).first << " : " << (*itr).second << endl;
  }
  s << "}" << endl;
  return s;
}

template<typename T> constexpr function<T(T, T)> ex_assign(T initE) {
  return [&initE](const T& x, const T& y) -> const T { return (y == initE) ? x : y; };
}
template<typename T> constexpr function<T(T, int)> ex_multiplies(T initE) {
  return [&initE](const T& x, size_t y) -> const T { return (x == initE) ? x : x * y; };
}
template<typename T, typename E> struct LazySegmentTree {
  using F = function<T(T, T)>;
  using G = function<T(T, E)>;
  using H = function<E(E, E)>;
  using P = function<E(E, int)>;

  int n;
  T initT;
  E initE;
  F f;
  G g;
  H h;
  P p;
  vector<T> data;
  vector<E> lazy;

  LazySegmentTree() {}
  LazySegmentTree(int n_, F f, G g, H h, T initT = INT_MAX, E initE = INT_MAX,
      vector<T> v = vector<T>(), P p = [](E a, size_t b) { ++b; return a; })
      : f(f), g(g), h(h), initT(initT), initE(initE), p(p) {
    n = 1;
    while (n < n_) n *= 2;
    data.assign(n * 2 - 1, initT);
    lazy.assign(n * 2 - 1, initE);
    if (n_ == v.size()) build(v);
  }
  void build(vector<T> v) {
    for (int i = 0; i < v.size(); ++i) data[i + n - 1] = v[i];
    for (int i = n - 2; i >= 0; --i) {
      data[i] = f(data[i * 2 + 1], data[i * 2 + 2]);
    }
  }
  inline void eval(int len, int k) {
    if (lazy[k] == initE) return;
    if (k * 2 + 1 < n * 2 - 1) {
      lazy[k * 2 + 1] = h(lazy[k * 2 + 1], lazy[k]);
      lazy[k * 2 + 2] = h(lazy[k * 2 + 2], lazy[k]);
    }
    data[k] = g(data[k], p(lazy[k], len));
    lazy[k] = initE;
  }
  T update(int a, int b, E x, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    eval(r - l, k);
    if (b <= l || r <= a) return data[k];
    if (a <= l && r <= b) {
      lazy[k] = h(lazy[k], x);
      return g(data[k], p(lazy[k], r - l));
    }
    T vl = update(a, b, x, k * 2 + 1, l, (l + r) / 2);
    T vr = update(a, b, x, k * 2 + 2, (l + r) / 2, r);
    return data[k] = f(vl, vr);
  }
  T query(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    eval(r - l, k);
    if (b <= l || r <= a) return initT;
    if (a <= l && r <= b) return data[k];
    T vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
    T vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
    return f(vl, vr);
  }
};
//
// e.g.
//      |     f     |   g   |   h   |   initT   | initE |   p
// -----+-----------+-------+-------+-----------+-------+--------
//  RMQ | min / max |       |       | INF / 0   |       | (mult)
//  RSQ | plus      |       |       | 0         |       | (mult)
//  RUQ |           | (ass) | (ass) |           | INF   | (mult)
//  RAQ |           | plus  | plus  |           | 0     | (mult)
//
//  (ass)  := ex_assign;
//  (mult) := ex_multiplies;
//

const int initT = 1 << 30;
const int initE = 1 << 30;
const LazySegmentTree<int, int>::F f = [](int a, int b) { return min(a, b); };
const LazySegmentTree<int, int>::G g = [](int a, int b) { return min(a, b); };
const LazySegmentTree<int, int>::H h = [](int a, int b) { return min(a, b); };
const LazySegmentTree<int, int>::P p = ex_multiplies<int>(initE);

map<int, int> compress(vector<int> v) {
  map<int, int> zip;
  for (int i = 0; i < v.size(); i++) {
    zip[v[i]] = -1;
  }
  int idx = 0;
  for (auto& p : zip) {
    p.second = idx++;
  }
  return zip;
}

int main() {
  int n, q;
  cin >> n >> q;
  vector<int> v = {-(1 << 30), 1 << 30};
  vector<int> s(n), t(n), x(n);
  for (int i = 0; i < n; i++) {
    cin >> s[i] >> t[i] >> x[i];
    v.push_back(s[i] - x[i]);
    v.push_back(t[i] - x[i]);
  }
  vector<int> d(q);
  for (int i = 0; i < q; i++) {
    cin >> d[i];
    v.push_back(d[i]);
  }

  auto zip = compress(v);
  LazySegmentTree<int, int> seg(zip.size(), f, g, h, initT, initE);
  for (int i = 0; i < n; i++) {
    int l = zip[s[i] - x[i]];
    int r = zip[t[i] - x[i]];
    seg.update(l, r, x[i]);
  }
  for (int i = 0; i < q; i++) {
    int t = zip[d[i]];
    int ans = seg.query(t, t + 1);
    cout << ((ans != (1 << 30)) ? ans : -1) << endl;
  }
}


Measured memory_bytes: 54468