/*
 * atcoder/abc128/e.cpp
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
#include <functional>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> ostream & operator << (ostream & out, vector<T> const & v) {
  for (auto &&a: v) out << a << " "; out << endl; return out;
}
template <class T> void dump(T &a) { cout << a << endl; }
template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }

/*
 *    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 * 0  2 2 10    - -
 * 1    a b c     e
 * 2    --- - c     e
 * 3            c     e
 * 4              c     e
 * 5                c     e
 * 6                  c      e
 * 7                    c       e
 * 8                      c        e
 * 9                         c        e
 * 10               -------------        e
 * 11                                       e
 * 12                                          e
 * 13                                             ----
 *
 * 最終的にぶつかるかどうかはすべて0地点の時間をマッピングすればO(1)で分かる.
 * 後は、衝突までの時間もO(1)で取る方法を考えれば良い.
 * 0地点にマッピングする際にその地点にマッピングされる最小のXを保持する. それがO(1)で取れる.
 *
 */
template<class Monoid, class Action> struct SegTree {
    using FuncMonoid = function< Monoid(Monoid, Monoid) >;
    using FuncAction = function< void(Monoid&, Action) >;
    using FuncLazy = function< void(Action&, Action) >;
    FuncMonoid FM;
    FuncAction FA;
    FuncLazy FL;
    Monoid UNITY_MONOID;
    Action UNITY_LAZY;
    int SIZE, HEIGHT;
    vector<Monoid> dat;
    vector<Action> lazy;
    
    SegTree() { }
    SegTree(int n, const FuncMonoid fm, const FuncAction fa, const FuncLazy fl,
            const Monoid &unity_monoid, const Action &unity_lazy)
    : FM(fm), FA(fa), FL(fl), UNITY_MONOID(unity_monoid), UNITY_LAZY(unity_lazy) {
        SIZE = 1; HEIGHT = 0;
        while (SIZE < n) SIZE <<= 1, ++HEIGHT;
        dat.assign(SIZE * 2, UNITY_MONOID);
        lazy.assign(SIZE * 2, UNITY_LAZY);
    }
    void init(int n, const FuncMonoid fm, const FuncAction fa, const FuncLazy fl,
              const Monoid &unity_monoid, const Action &unity_lazy) {
        FM = fm; FA = fa; FL = fl;
        UNITY_MONOID = unity_monoid; UNITY_LAZY = unity_lazy;
        SIZE = 1; HEIGHT = 0;
        while (SIZE < n) SIZE <<= 1, ++HEIGHT;
        dat.assign(SIZE * 2, UNITY_MONOID);
        lazy.assign(SIZE * 2, UNITY_LAZY);
    }
    
    /* set, a is 0-indexed */
    void set(int a, const Monoid &v) { dat[a + SIZE] = v; }
    void build() {
        for (int k = SIZE - 1; k > 0; --k)
            dat[k] = FM(dat[k*2], dat[k*2+1]);
    }
    
    /* update [a, b) */
    inline void evaluate(int k) {
        if (lazy[k] == UNITY_LAZY) return;
        if (k < SIZE) FL(lazy[k*2], lazy[k]), FL(lazy[k*2+1], lazy[k]);
        FA(dat[k], lazy[k]);
        lazy[k] = UNITY_LAZY;
    }
    inline void update(int a, int b, const Action &v, int k, int l, int r) {
        evaluate(k);
        if (a <= l && r <= b)  FL(lazy[k], v), evaluate(k);
        else if (a < r && l < b) {
            update(a, b, v, k*2, l, (l+r)>>1), update(a, b, v, k*2+1, (l+r)>>1, r);
            dat[k] = FM(dat[k*2], dat[k*2+1]);
        }
    }
    inline void update(int a, int b, const Action &v) { update(a, b, v, 1, 0, SIZE); }
    
    /* get [a, b) */
    inline Monoid get(int a, int b, int k, int l, int r) {
        evaluate(k);
        if (a <= l && r <= b)
            return dat[k];
        else if (a < r && l < b)
            return FM(get(a, b, k*2, l, (l+r)>>1), get(a, b, k*2+1, (l+r)>>1, r));
        else
            return UNITY_MONOID;
    }
    inline Monoid get(int a, int b) { return get(a, b, 1, 0, SIZE); }
    inline Monoid operator [] (int a) { return get(a, a+1); }
    
    /* debug */
    void print() {
        for (int i = 0; i < SIZE; ++i) { cout << (*this)[i]; if (i != SIZE) cout << ","; }
        cout << endl;
    }
};
ll N, Q;
vector<ll> S, T, X, D, C;
void solve() {
  cin >> N >> Q;
  S.resize(N);
  T.resize(N);
  X.resize(N);
  D.resize(Q);
  C.push_back(-(1LL<<60));
  C.push_back(1LL<<60);
  loop(n,0,N) {
    cin >> S[n] >> T[n] >> X[n];
    C.push_back(S[n]-X[n]);
    C.push_back(T[n]-X[n]);
  }
  loop(q,0,Q) {
    cin >> D[q];
    C.push_back(D[q]);
  }
  sort(C.begin(), C.end());
  C.erase(unique(C.begin(), C.end()), C.end());

  ll INF = numeric_limits<ll>::max();
  auto fm = [](ll a, ll b) { return min(a, b); };
  auto fa = [](ll &a, ll d) { chmin(a, d); };
  auto fl = [](ll &d, ll e) { chmin(d, e); };
  ll M = C.size();
  SegTree<ll, ll> rmq(M + 10, fm, fa, fl, INF, INF);

  ll x, y;
  loop(n,0,N) {
    x = lower_bound(C.begin(), C.end(), S[n]-X[n]) - C.begin();
    y = lower_bound(C.begin(), C.end(), T[n]-X[n]) - C.begin();
    rmq.update(x, y, X[n]);
  }

  loop(q,0,Q) {
    x = lower_bound(C.begin(), C.end(), D[q]) - C.begin();
    ll val = rmq.get(x, x+1);
    if (val == INF) cout << -1 << endl;
    else cout << val << endl;
  }
}
int main() {
  // cout.precision(15); cout << fixed;

  solve();

  return 0;
}


Measured memory_bytes: 46696