#include <chrono>

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <time.h>
#include <random>
#include <string>
#include <cassert>
#include <vector>
#include <ostream>
#include <istream>
#include <stack>
#include <deque>
#include <queue>
#include <functional>

using namespace std;

#define int long long
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define pii pair<int, int>
#define ld long double

ostream& operator << (ostream &a, const vector<int> &b) {
    for (auto k : b) cout << k << " ";
    return a;
}

#ifdef LOCAL
    #define dbg(x) cout << #x << " : " << (x) << "\n";
    const int INF = 1e18;
//    const int mod = 2600000069;
//    const int p = 10;
//    const ld PI = 3.1415926535;
#else
    #define dbg(x)
    const int INF = 1e18;
//    const int mod = 2600000069;
//    const int p = 179;
//    const ld PI = 3.1415926535;
#endif

//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,sse3,sse4")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("fast-math")
//#pragma GCC target("avx2")
//#pragma GCC optimize("section-anchors")
//#pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
//#pragma GCC optimize("vpt")
//#pragma GCC optimize("rename-registers")
//#pragma GCC optimize("move-loop-invariants")
//#pragma GCC optimize("unswitch-loops")
//#pragma GCC optimize("function-sections")
//#pragma GCC optimize("data-sections")

struct road {
    int x, s, t;
    road() {}
};

struct event {
    int x, t, val;
    event() {}
    event(int x_, int t_, int val_) {
        x = x_;
        t = t_;
        val = val_;
    }
};

inline bool comp(const event& a, const event& b) {
    if (a.x == b.x) return a.t < b.t; // a.t == 0 значит что это начало отрезка и 2 означает конец
    return a.x < b.x;
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifdef LOCAL
    #else
//        freopen("capitals.in", "r", stdin);
//        freopen("capitals.out", "w", stdout);
    #endif
    int n, q;
    cin >> n >> q;
    vector<road> a(n);
    vector<event> b(2 * n);
    for (int i = 0; i < n; i++) {
        cin >> a[i].s >> a[i].t >> a[i].x;
        a[i].s -= a[i].x;
        a[i].t -= a[i].x;
        b[2 * i] = event(a[i].s, 0, a[i].x);
        b[2 * i + 1] = event(a[i].t - 1, 2, a[i].x);
    }
    int d;
    for (int i = 0; i < q; i++) {
        cin >> d;
        b.pb(event(d, 1, i)); // val у запроса это индекс
    }
    vector<int> ans(q, -1);
    sort(all(b), comp);
    multiset<int> cur;
    int ind = 0;
    int curx;
    int sz = b.size();
    while (ind < sz) {
        curx = b[ind].x;
        while (ind < sz && b[ind].x == curx && b[ind].t == 0) {
            cur.insert(b[ind].val);
            ind++;
        }
        while (ind < sz && b[ind].x == curx && b[ind].t == 1) {
            if (!cur.empty()) ans[b[ind].val] = *cur.begin();
            ind++;
        }
        while (ind < sz && b[ind].x == curx && b[ind].t == 2) {
            cur.erase(cur.lower_bound(b[ind].val));
            ind++;
        }
    }
    for (int i = 0; i < q; i++) cout << ans[i] << "\n";
}
/*

*/


Measured memory_bytes: 31584