#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#define limit(x, l, r) max(l, min(x, r))
#define lims(x, l, r) (x = max(l, min(x, r)))
#define isin(x, l, r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)), x.end())
#define show(x) cout << #x << " = " << x << endl;
#define print(x) cout << x << endl;
#define PQ(T) priority_queue<T, v(T), greater<T> >
#define bn(x) ((1 << x) - 1)
#define dup(x, y) (((x) + (y)-1) / (y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;

const ll inf = 1LL << 60;

template <class V, int NV>
struct LazySegTree {  // [L,R)
  vector<V> dat, lazy;
  LazySegTree() {
    dat.resize(NV * 2, def);
    lazy.resize(NV * 2, ldef);
  }
  void update(int a, int b, V v, int k, int l, int r) {
    push(k, l, r);
    if (r <= a || b <= l) return;
    if (a <= l && r <= b) {
      setLazy(k, v);
      push(k, l, r);
    } else {
      update(a, b, v, k * 2 + 1, l, (l + r) / 2);
      update(a, b, v, k * 2 + 2, (l + r) / 2, r);
      dat[k] = comp(dat[k * 2 + 1], dat[k * 2 + 2]);
    }
  }
  V get(int a, int b, int k, int l, int r) {
    push(k, l, r);
    if (r <= a || b <= l) return def;
    if (a <= l && r <= b) return dat[k];
    auto x = get(a, b, k * 2 + 1, l, (l + r) / 2);
    auto y = get(a, b, k * 2 + 2, (l + r) / 2, r);
    return comp(x, y);
  }
  void update(int a, int b, V v) { update(a, b, v, 0, 0, NV); }
  V get(int a, int b) { return get(a, b, 0, 0, NV); }
  // ---- Template
  // ---------------------------------------------------------------------------------
  // 区間min代入,区間min
  const V def = inf, ldef = inf;
  V comp(V l, V r) { return min(l, r); }
  void setLazy(int i, V v) { lazy[i] = min(lazy[i], v); }
  void push(int k, int l, int r) {
    if (lazy[k] != ldef) {
      // modify------------------------------
      dat[k] = min(dat[k], lazy[k]);
      // ------------------------------------
      if (r - l > 1) {
        setLazy(k * 2 + 1, lazy[k]);
        setLazy(k * 2 + 2, lazy[k]);
      }
      lazy[k] = ldef;
    }
  }
};

LazySegTree<ll, 1 << 18> st;

// int N, Q, S[201010], T[201010], X[201010], D[201010];
// int main() {
// 	cin >> N >> Q;
// 	rep(i, N) cin >> S[i] >> T[i] >> X[i];
// 	rep(i, Q) cin >> D[i];
 
// 	vector<int> queue;
// 	rep(i, Q) queue.push_back(D[i]);
 
// 	rep(i, N) {
// 		int L = S[i] - X[i];
// 		int R = T[i] - X[i];
 
// 		if (R <= 0) continue;
 
// 		maxs(L, 0);
 
// 		int a = lower_bound(rng(queue), L) - queue.begin();
// 		int b = lower_bound(rng(queue), R) - queue.begin();
 
// 		st.update(a, b, X[i]);
// 	}
 
// 	rep(q, Q) {
// 		ll ans = st.get(q, q + 1);
// 		if (ans == inf) ans = -1;
// 		printf("%Ld\n", ans);
// 	}
// }

int main() {
  int n, q;
  cin >> n >> q;
  vl s(n), t(n), x(n), d(q);
  rep(i, n) { cin >> s[i] >> t[i] >> x[i]; }
  rep(i, q) { cin >> d[i]; }
  rep(i, n) {
    ll l = s[i] - x[i];
    ll r = t[i] - x[i];
		if (r <= 0) continue;
		maxs(l, 0LL);
    int a = lower_bound(rng(d), l) - d.begin();
    int b = lower_bound(rng(d), r) - d.begin();
    st.update(a, b, x[i]);
  }
  rep(i, q) {
    ll ans = st.get(i, i + 1);
    if(ans == inf)ans = -1;
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 17760