#include <bits/stdc++.h>

using namespace std;

/* g++ -g -fsanitize=address -lasan -std=c++11 -Dfoo_ */

/* freopen("input.txt", "rt", stdin); */
/* freopen("output.txt", "wt", stdout); */

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

/*
 *      |  t    Suppose at position x, the schedule is [s,t), based
 * time | /|    y = x+b, we can find the mapping position on time
 *      |/ s    axis [b1,b2). If Di is in [b1,b2), it will be stopped
 *     b2 /     at x.
 *      |/
 *     b1  |    We can use a segtree to keep the value of all [bi,bj).
 *      |- x -
 */

const int inf = 1e9;
const int maxn = 2e5+5;
VI tree;
struct ST { int s,t,x; } st[maxn];

void build(const int n)
{
    for (int i = n-1; i > 0; --i)
        tree[i] = min(tree[lc(i)], tree[rc(i)]);
}

void update(int i, int j, const int value, const int n)
{
    for (i += n, j += n; i < j; i >>= 1, j >>= 1) {
        if (i&1) { tree[i] = min(tree[i], value); i++; }
        if (j&1) { --j; tree[j] = min(tree[j], value); }
    }
}

void pushdown(const int n)
{
    for (int i = 1; i < n; i++) {
        tree[lc(i)] = min(tree[lc(i)], tree[i]);
        tree[rc(i)] = min(tree[rc(i)], tree[i]);
        tree[i] = inf;
    }
}

int main()
{
#ifdef foo_
    freopen("foo", "rt", stdin);
#endif
    ios::sync_with_stdio(false);
    int n,q;
    while (cin >> n >> q) {
        VI point, D(q);
        FOR(i,0,n) {
            int s,t,x; cin >> s >> t >> x;
            /* y = x + b */
            const int b1 = max(0,s-x);
            const int b2 = max(0,t-x);
            st[i].s = b1; st[i].t = b2; st[i].x  = x;
            point.push_back(b1);
            point.push_back(b2);
        }
        FOR(i,0,q) {
            cin >> D[i]; point.push_back(D[i]);
        }
        /* de-dup */
        sort(ALL(point));
        point.resize(unique(ALL(point)) - point.begin());
        const int size = point.size();
        tree = VI(2*size,inf);
        FOR(i,0,n) {
            const int a = lower_bound(ALL(point),st[i].s) - point.begin();
            const int b = lower_bound(ALL(point),st[i].t) - point.begin();
            update(a,b,st[i].x,size);
        }
        pushdown(size);
        FOR(i,0,q) {
            const int d = lower_bound(ALL(point),D[i]) - point.begin();
            const int v = tree[d+size];
            cout << (v == inf ? -1 : v) << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 12524