#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)

int main()
{
    int N, Q;
    cin >> N >> Q;
    vector<vector<int>> data(N, vector<int>(3));
    REP(i, N){
        cin >> data[i][1] >> data[i][2] >> data[i][0];
        data[i][1] -= data[i][0];
        data[i][2] -= data[i][0];
    }
    set<pair<int,int>> s;
    REP(i, Q){
        int D;
        cin >> D;
        s.insert({D,i});
    }

    sort(data.begin(), data.end());

    vector<int> ans(Q, -1);
    REP(i, N){
        auto itr = s.lower_bound({data[i][1], -1});
        while(itr != s.end() and itr != s.upper_bound({data[i][2], -1})){
            ans[(*itr).second] = data[i][0];
            s.erase(itr++);
        }
    }

    REP(i, Q) cout << ans[i] << endl;

    return 0;
}