#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define WHATIS(x) cout << #x << " is " << x << endl;
#define ERROR(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<ll, II> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << *it << " = " << a << endl;
    err(++it, args...);
}

const ll MODBASE = 1000000007LL;
const int MAXN = 200010;
const int MAXM = 100010;
const int MAXK = 510;
const int MAXQ = 200010;

struct BlockedPoint {
    int st, en, pos;
    BlockedPoint(int pos = 0, int st = 0, int en = 0) : pos(pos), st(st), en(en) {}
};

bool operator< (BlockedPoint a, BlockedPoint b) {
    if (a.pos == b.pos) return a.st < b.st;
    return a.pos < b.pos;
}

BlockedPoint a[MAXN];
int n, q, lazy[MAXN * 24], t[MAXN * 24];
vector<int> b;
set<int> s;

int get(int u) {
    int dau = 0, cuoi = SZ(b)-1;
    while (dau <= cuoi) {
        int mid = (dau + cuoi) >> 1;
        if (b[mid] >= u) cuoi = mid-1;
        else dau = mid+1;
    }
    return dau+1;
}

void lazy_upd(int k, int l, int r) {
    if (l > r) return;
    if (lazy[k]) t[k] = lazy[k];
    if (l < r && lazy[k]) {
        lazy[k * 2] = lazy[k];
        lazy[k * 2 + 1] = lazy[k];
    }
    lazy[k] = 0;
}

void update(int k, int l, int r, int u, int v, int val) {
    lazy_upd(k,l,r);
    if (l > r || r < u || v < l) return;
    if (u <= l && r <= v) {
        lazy[k] = val;
        lazy_upd(k,l,r);
        return;
    }
    int m = (l+r) >> 1;
    update(k*2, l, m, u, v, val);
    update(k*2+1, m+1, r, u, v, val);
}

int Get(int k, int l, int r, int u) {
    lazy_upd(k, l, r);
    if (l > r || r < u || u < l) return 0;
    if (l == r) return t[k];
    int m = (l + r) >> 1;
    if (u <= m) return Get(k * 2, l, m, u);
    return Get(k * 2 + 1, m + 1, r, u);
}

int calc(int d) {
    int g = get(d);
    if (g > SZ(b)) return -1;
    int h = Get(1,1,SZ(b),g);
    if (h == -2100000000) return -1; 
    return h;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> n >> q;
    FOR(i,1,n) cin >> a[i].st >> a[i].en >> a[i].pos;
    sort(a+1, a+n+1);
    FORE(i,n,1) {
        int l = a[i].st;
        int r = a[i].en - 1;
        l -= a[i].pos;
        r -= a[i].pos;
        s.insert(l);
        s.insert(r);
        s.insert(l-1);
    }
    FORALL(it, s) b.emplace_back(*it);
    // FOR(i,0,SZ(b)-1) cout << b[i] << ' ';
    // cout << endl;
    FORE(i,n,1) {
        int l = a[i].st;
        int r = a[i].en - 1;
        l -= a[i].pos;
        r -= a[i].pos;
        // cout << "----- " << get(l-1) << endl; 
        update(1,1,SZ(b),get(l-1),get(l-1),-2100000000);
    }
    FORE(i,n,1) {
        int l = a[i].st;
        int r = a[i].en - 1;
        l -= a[i].pos;
        r -= a[i].pos;
        update(1,1,SZ(b),get(l),get(r),a[i].pos);
    }
    FOR(i,1,q) {
        int d;
        cin >> d;
        cout << calc(d) << "\n";
    }
    
    return 0;
}

Measured memory_bytes: 56940