#pragma GCC optimize ("O3")

#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vec) {
    os << "{ ";
    REP(i, vec.size()) {
        os << vec[i] << " ";
    }
    os << "}";

    return os;
}

ll pow_mod(ll a, ll p) {
    ll res = 1;
    while(p) {
        if (p & 1) res = (res * a) % MOD;
        a = (a * a) % MOD;
        p >>= 1;
    }

    return res;
}


ll mod_inv(ll a, ll m) {
    ll b = m, u = 0, v = 1;
    while(a) {
        ll t = b / a;
        swap(b -= t * a, a);
        swap(u -= t * v, v);
    }

    return (u % m + m) % m;
}

ll gcd(ll a, ll b) {
    if(b == 0) return a;
    return gcd(b, a%b);
}

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

#ifdef LOCAL
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

const int NMAX = int(1e6);

map<ll, int> zip;
ll unzip[NMAX];

int compress(vector<ll>& v) {
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
    REP (i, v.size()) {
        zip[v[i]] = i;
        unzip[i] = v[i];
    }
    return v.size();
}


int get_n(int n) {
    int ret = 1; while(ret < n) ret <<= 1;

    return ret;
}

struct SegTree {
    int N;
    vector<ll> dat;
    vector<ll> lazy;

    explicit SegTree(int n): N(get_n(n)), dat(2*N-1, INF), lazy(2*N-1, INF) {}

    void eval(int k, int l, int r) {
        if (lazy[k] < INF) {
            dat[k] = min(dat[k], lazy[k]);

            if (r - l > 1) {
                lazy[2*k+1] = min(lazy[2*k+1], lazy[k]);
                lazy[2*k+2] = min(lazy[2*k+2], lazy[k]);
            }

            lazy[k] = INF;
        }
    }

    void update(int a, int b, ll v, int k=0, int l=0, int r=-1) {
        if(r < 0) r = N;

        if (b <= l || r <= a) return;
      
        eval(k, l, r);

        if (a <= l && r <= b) {
            lazy[k] = min(lazy[k], v);
            return;
        }

        int mid = (l + r) / 2;
        update(a, b, v, 2 * k + 1, l, mid);
        update(a, b, v, 2 * k + 2, mid, r);
    }

    ll query(int a, int b=-1, int k=0, int l=0, int r=-1) {
        if (r < 0) r = N;
        if (b < 0) b = a + 1;

        if (b <= l || r <= a) return INF;
      
        eval(k, l, r);

        if (a <= l && r <= b) return dat[k];

        int mid = (l + r) / 2;
        ll c0 = query(a, b, 2 * k + 1, l, mid);
        ll c1 = query(a, b, 2 * k + 2, mid, r);

        return min(c0, c1);
    }

    void print() {
        cout << "dat: " << endl;
        REP(i, dat.size()) {
            if (i > 0) cout << " ";

            if (dat[i] > NMAX) cout << "INF";
            else cout << dat[i];
        }

        cout << endl;

        cout << "lazy: " << endl;
        REP(i, lazy.size()) {
            if (i > 0) cout << " ";

            if (lazy[i] > NMAX) cout << "INF";
            else cout << lazy[i];
        }

        cout << endl;
    }
};



int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    
    int N, Q;
    cin >> N >> Q;

    vector<ll> S(N), T(N), X(N);
    REP(i, N) {
        ll s, t, x;
        cin >> s >> t >> x;
        S[i] = s - x;
        T[i] = t - x;
        X[i] = x;
    }

    vector<ll> D(Q);
    REP(i, Q) {
        cin >> D[i];
    }

    vector<ll> tmp(3 * N + Q);
    copy(S.begin(), S.end(), tmp.begin());
    copy(T.begin(), T.end(), tmp.begin() + N);
    copy(X.begin(), X.end(), tmp.begin() + 2*N);
    copy(D.begin(), D.end(), tmp.begin() + 3*N);

    compress(tmp);

    SegTree st(zip.size());

    REP(i, N) {
        st.update(zip[S[i]], zip[T[i]], zip[X[i]]);
    }


    REP(i, Q) {
        ll ans = st.query(zip[D[i]]);
        if (ans == INF) cout << -1 << endl;
        else cout << unzip[ans] << endl;
    }

}


Measured memory_bytes: 102784