/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>

#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1 << 20
#define fcout cout << fixed << setprecision(12)

using namespace std;

template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
    for (auto& e:t) fill_v(e, v);
}

typedef pair<int, int> P;

template<class V, int NV>
class SegTree {
public:
    vector<V> val;

    SegTree() { val.resize(NV * 2, 1LL << 60); };

    V getval(int entry) {
        entry += NV;
        int ret = val[entry];
        while (entry > 1) entry >>= 1, ret = min(ret, val[entry]);
        return ret;
    }

    void update(int x, int y, V v, int l = 0, int r = NV, int k = 1) {
        if (l >= r) return;
        if (x <= l && r <= y) val[k] = min(val[k], v);
        else if (l < y && x < r) {
            update(x, y, v, l, (l + r) / 2, k * 2);
            update(x, y, v, (l + r) / 2, r, k * 2 + 1);
        }
    }
};


class ERoadwork {
public:
    void solve(std::istream& cin, std::ostream& cout) {
        int N, Q;
        cin >> N >> Q;

        vector<int> S(N), T(N), X(N);
        vector<int> v;

        REP(i, N) {
            int s, t, x;
            cin >> s >> t >> x;
            S[i] = s;
            T[i] = t;
            X[i] = x;
            int l = max(s - x, 0LL);
            int r = max(t - x, 0LL);
            v.push_back(l);
            v.push_back(r);
        }
        vector<int> D(Q);
        REP(i, Q) {
            cin >> D[i];
            v.push_back(D[i]);
        }
        sort(v.begin(), v.end());
        v.erase(unique(v.begin(), v.end()), v.end());

        map<int, int> id;
        REP(i, v.size()) {
            id[v[i]] = i;
        }

        SegTree<int, 1 << 20> seg;
        REP(i, N) {
            int l = max(S[i] - X[i], 0LL);
            int r = max(T[i] - X[i], 0LL);
            seg.update(id[l], id[r], X[i]);
        }

        REP(i, Q) {
            int t = id[D[i]];
            int res = seg.getval(t);
            if (res == 1LL << 60) res = -1;
            cout << res << endl;
        }

    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    ERoadwork solver;
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 66024