#include <iostream>
#include<bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
set<ll> se;
ll n,q,a,b,c;
vector<PP> v;
int main(void){
    cin>>n>>q;
    for(int i=0;i<n;i++){
        cin>>a>>b>>c;
        v.push_back({a-c,{0,c}});
        v.push_back({b-c-1,{2,c}});
    }
    while(q--){
        cin>>a;
        v.push_back({a,{1,0}});
    }
    sort(v.begin(),v.end());
    for(auto x:v){
        if(x.S.F==0)se.insert(x.S.S);
        else if(x.S.F==2)se.erase(x.S.S);
        else{
            if(se.size()==0)cout<<-1<<endl;
            else cout<<*se.begin()<<endl;
        }
    }
}
