#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#include <cassert>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
using namespace std;
using ll = long long;
constexpr ll INF = 3000000000000000000;

template <typename Operator>
struct LazySegmentTree {
    Operator OP;
    using NodeType = decltype(OP.NodeE);
    using FuncType = decltype(OP.FuncE);
    int length, height;
    vector<NodeType> node;
    vector<FuncType> lazy;
    vector<int> width;
    LazySegmentTree(int n) {
        length = 1;
        height = 0;
        while (length < n) {
            length <<= 1;
            ++height;
        }
        node.resize(length << 1, OP.NodeE);
        lazy.resize(length << 1, OP.FuncE);
        width.resize(length << 1, 1);
        for (int i = length - 1; i > 0; --i) width[i] = width[i << 1] << 1;
    }
    LazySegmentTree(vector<NodeType> &vec) {
        length = 1;
        height = 0;
        while (length < SZ(vec)) {
            length <<= 1;
            ++height;
        }
        node.resize(length << 1, OP.NodeE);
        REP(i, SZ(vec)) node[i + length] = vec[i];
        for (int i = length - 1; i > 0; --i) node[i] = OP.MergeNode(node[(i << 1) | 0], node[(i << 1) | 1]);
        lazy.resize(length << 1, OP.FuncE);
        width.resize(length << 1, 1);
        for (int i = length - 1; i > 0; --i) width[i] = width[i << 1] << 1;
    }
    void eval(int n) {
        node[n] = OP.NodeFunc(node[n], lazy[n], width[n]);
        if (n < length) {
            lazy[(n << 1) | 0] = OP.MergeFunc(lazy[(n << 1) | 0], lazy[n]);
            lazy[(n << 1) | 1] = OP.MergeFunc(lazy[(n << 1) | 1], lazy[n]);
        }
        lazy[n] = OP.FuncE;
    }
    void update(int a, int b, FuncType x) {
        int l = a + length, r = b + length - 1;
        for (int i = height; i > 0; --i) {
            eval(l >> i);
            eval(r >> i);
        }
        ++r;
        while (r > l) {
            if (l & 1) {
                lazy[l] = OP.MergeFunc(lazy[l], x);
                eval(l);
                ++l;
            }
            if (r & 1) {
                --r;
                lazy[r] = OP.MergeFunc(lazy[r], x);
                eval(r);
            }
            l >>= 1; r >>= 1;
        }
        l = a + length; r = b + length - 1;
        while (l >>= 1) node[l] = OP.MergeNode(OP.NodeFunc(node[(l << 1) | 0], lazy[(l << 1) | 0], width[(l << 1) | 0]), OP.NodeFunc(node[(l << 1) | 1], lazy[(l << 1) | 1], width[(l << 1) | 1]));
        while (r >>= 1) node[r] = OP.MergeNode(OP.NodeFunc(node[(r << 1) | 0], lazy[(r << 1) | 0], width[(r << 1) | 0]), OP.NodeFunc(node[(r << 1) | 1], lazy[(r << 1) | 1], width[(r << 1) | 1]));
    }
    NodeType get(int a, int b) {
        int l = a + length, r = b + length - 1;
        for (int i = height; i >= 0; --i) {
            eval(l >> i);
            eval(r >> i);
        }
        ++r;
        NodeType vl = OP.NodeE, vr = OP.NodeE;
        while (l < r) {
            if (l & 1) {
                vl = OP.MergeNode(vl, OP.NodeFunc(node[l], lazy[l], width[l]));
                ++l;
            }
            if (r & 1) {
                --r;
                vr = OP.MergeNode(OP.NodeFunc(node[r], lazy[r], width[r]), vr);
            }
            l >>= 1; r >>= 1;
        }
        return OP.MergeNode(vl, vr);
    }
};

struct hoge {
    ll NodeE = INF;
    ll FuncE = INF;
    ll MergeNode(ll x, ll y) {
        return min(x, y);
    }
    ll MergeFunc(ll x, ll y) {
        return min(x, y);
    }
    ll NodeFunc(ll x, ll y, int len) {
        return min(x, y);
    }
};

int main() {
    int n, q;
    cin >> n >> q;
    vector<ll> s(n), t(n), x(n), d(q);
    REP(i, n) cin >> s[i] >> t[i] >> x[i];
    REP(i, q) cin >> d[i];
    
    set<ll> st;
    REP(i, n) {
        st.insert(s[i] - x[i]);
        st.insert(t[i] - x[i]);
    }
    REP(i, q) {
        st.insert(d[i]);
    }
    map<ll, int> mp;
    int k = 0;
    while (!st.empty()) {
        mp[*begin(st)] = k;
        st.erase(*begin(st));
        ++k;
    }
    
    LazySegmentTree<hoge> LST(k);
    REP(i, n) {
        LST.update(mp[s[i] - x[i]], mp[t[i] - x[i]], x[i]);
    }
    REP(i, q) {
        ll ans = LST.get(mp[d[i]], mp[d[i]] + 1);
        if (ans == INF) cout << -1 << "\n";
        else cout << ans << "\n";
    }
    
    return 0;
}


Measured memory_bytes: 91040