#include <bits/stdc++.h>
#define ll long long
#define BUF 1e5
constexpr int INF = (1LL << 31) - 1;
constexpr ll mod = 1e9 + 7;
using namespace std;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
class LazySegmentTreeSUM {
public:
    vector<T> node;
    vector<bool> lazyflag;
    vector<T> lazy;
    int size;
    int n;
    LazySegmentTreeSUM() {}
    LazySegmentTreeSUM(vector<T> in) {
        int in_sz = in.size();
        n = 1;
        while (n < in_sz) {
            n *= 2;
        }
        size = n * 2 - 1;
        node.resize(size, 0);
        lazy.resize(size, 0);
        lazyflag.resize(size, 0);
        for (int i = 0; i < in_sz; i++) {
            node[n - 1 + i] = in[i];
        }
        init_dfs(0);
    }

    int init_dfs(int now) {
        if (2 * now + 1 >= size)
            return node[now];
        node[now] = init_dfs(2 * now + 1) + init_dfs(2 * now + 2);
        return node[now];
    }
    void eval(int now, int l, int r) {
        if (lazyflag[now] == 1) {
            node[now] += lazy[now];
            if (r - l > 1) {
                lazy[2 * now + 1] += lazy[now] / 2;
                lazyflag[2 * now + 1] = 1;
                lazy[2 * now + 2] += lazy[now] / 2;
                lazyflag[2 * now + 2] = 1;
            }
            lazyflag[now] = 0;
            lazy[now] = 0;
        }
    }

    void add(int a, int b, T val) {
        _add(a, b + 1, val, 0, 0, n);
    }

    void _add(int a, int b, T val, int now, int l, int r) {
        eval(now, l, r);
        if (r <= a || b <= l)
            return;
        if (a <= l && r <= b) {
            lazy[now] += (r - l) * val;
            lazyflag[now] = 1;
            eval(now, l, r);
            return;
        }
        _add(a, b, val, 2 * now + 1, l, (l + r) / 2);
        _add(a, b, val, 2 * now + 2, (l + r) / 2, r);
        node[now] = node[2 * now + 1] + node[2 * now + 2];
    }

    T query(int a, int b) {
        return _query(a, b + 1, 0, 0, n);
    }

    T _query(int a, int b, int now, int l, int r) {
        if (r <= a || b <= l)
            return 0;
        eval(now, l, r);
        if (a <= l && r <= b)
            return node[now];
        T val_l = _query(a, b, 2 * now + 1, l, (l + r) / 2);
        T val_r = _query(a, b, 2 * now + 2, (l + r) / 2, r);
        return val_l + val_r;
    }
};
template <typename T>
class LazySegmentTreeRMQ {
public:
    vector<T> node;
    vector<bool> lazyflag;
    vector<T> lazy;
    int size;
    int n;
    LazySegmentTreeRMQ() {}
    LazySegmentTreeRMQ(vector<T> in) {
        int in_sz = in.size();
        n = 1;
        while (n < in_sz) {
            n *= 2;
        }
        size = n * 2 - 1;
        node.resize(size, INF);
        lazy.resize(size, INF);
        lazyflag.resize(size, 0);
        for (int i = 0; i < in_sz; i++) {
            node[n - 1 + i] = in[i];
        }
        init_dfs(0);
    }

    int init_dfs(int now) {
        if (2 * now + 1 >= size)
            return node[now];
        node[now] = init_dfs(2 * now + 1) + init_dfs(2 * now + 2);
        return node[now];
    }
    void eval(int now, int l, int r) {
        if (lazyflag[now] == 1) {
            node[now] = min(node[now], lazy[now]);
            if (r - l > 1) {
                lazy[2 * now + 1] = min(lazy[2 * now + 1], lazy[now]);
                lazyflag[2 * now + 1] = 1;
                lazy[2 * now + 2] = min(lazy[2 * now + 2], lazy[now]);
                lazyflag[2 * now + 2] = 1;
            }
            lazyflag[now] = 0;
            lazy[now] = INF;
        }
    }

    void update(int a, int b, T val) {
        _update(a, b, val, 0, 0, n);
    }

    void _update(int a, int b, T val, int now, int l, int r) {
        eval(now, l, r);
        if (r <= a || b <= l)
            return;
        if (a <= l && r <= b) {
            lazy[now] = val;
            lazyflag[now] = 1;
            eval(now, l, r);
            return;
        }
        _update(a, b, val, 2 * now + 1, l, (l + r) / 2);
        _update(a, b, val, 2 * now + 2, (l + r) / 2, r);
        node[now] = min(node[2 * now + 1], node[2 * now + 2]);
    }

    T query(int a, int b) {
        return _query(a, b, 0, 0, n);
    }

    T _query(int a, int b, int now, int l, int r) {
        if (r <= a || b <= l)
            return INF;
        eval(now, l, r);
        if (a <= l && r <= b)
            return node[now];
        T val_l = _query(a, b, 2 * now + 1, l, (l + r) / 2);
        T val_r = _query(a, b, 2 * now + 2, (l + r) / 2, r);
        return min(val_l, val_r);
    }
};

int main() {
    cin >> N >> Q;
    vector<int> s(N), t(N), x(N);
    vector<int> zat;
    for (int i = 0; i < N; i++) {
        cin >> s[i] >> t[i] >> x[i];
        s[i] -= x[i];
        t[i] -= x[i];
        zat.push_back(s[i]);
        zat.push_back(t[i]);
    }
    vector<int> d(Q);
    for (int i = 0; i < Q; i++) {
        cin >> d[i];
        zat.push_back(d[i]);
    }
    sort(zat.begin(), zat.end());
    zat.erase(unique(zat.begin(), zat.end()), zat.end());
    map<int, int> mp;
    for (int i = 0; i < zat.size(); i++) {
        mp[zat[i]] = i;
    }
    vector<ll> v(zat.size(), INF);
    LazySegmentTreeRMQ<ll> lst(v);
    for (int i = 0; i < N; i++) {
        lst.update(mp[s[i]], mp[t[i]], x[i]);
    }
    for (int i = 0; i < Q; i++) {
        int mpd = mp[d[i]];
        int tmp = lst.query(mpd, mpd + 1);

        cout << (tmp == INF ? -1 : tmp) << endl;
    }
}

Measured memory_bytes: 77932