#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <math.h>
#include<iomanip>
using namespace std;

int N, Q;

int main() {
    cin >> N >> Q;
    vector<pair<pair<long long, bool>, long long>> event;
    long long s, t, x;
    for (int i = 0; i < N; i++) {
        cin >> s >> t >> x;
        event.push_back({{s - x, true}, x});
        event.push_back({{t - x, false}, x});
    }
    long long d;
    for (int i = 0; i < Q; i++) {
        cin >> d;
        event.push_back({{d, true}, 1e9 + 1});
    }
    sort(event.begin(), event.end());
    set<long long> S;
    for (auto e : event) {
        x = e.second;
        if (x > 1e9) {
            cout << (S.empty()? -1 : *S.begin()) << endl;
            continue;
        }
        if (e.first.second) {
            S.insert(x);
        } else {
            S.erase(x);
        }
    }
}
