#include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <numeric>
#include <limits>
#include <type_traits>
#include <locale>

using namespace std;
#define SAY_YES cout << "YES" << endl;
#define SAY_Yes cout << "Yes" << endl;
#define SAY_NO cout << "NO" << endl;
#define SAY_No cout << "No" << endl;
#define IFYES(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "YES" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "NO" << endl;  \
    }
#define IFYes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "Yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "No" << endl;  \
    }
#define IFyes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "no" << endl;  \
    }
#define DEBUG_OUTPUT_ARRAY(XXX, ONE)                            \
    for (int i = 0; i < (ONE); i++)                             \
    {                                                           \
        cout << "DEBUG: i = " << i << " -> " << XXX[i] << endl; \
    }
#define DEBUG_OUTPUT_ARRAY2(XXX, ONE, TWO)                             \
    for (int i = 0; i < (ONE); i++)                                    \
    {                                                                  \
        cout << "<<< i = " << i << " >>>" << endl;                     \
        for (int j = 0; j < (TWO); j++)                                \
        {                                                              \
            cout << "DEBUG: j = " << j << " -> " << XXX[i][j] << endl; \
        }                                                              \
    }
#define DEBUG_OUTPUT_ARRAY2_BOX(XXX, ONE, TWO) \
    for (int i = 0; i < (ONE); i++)            \
    {                                          \
        cout << i << "  ";                     \
        for (int j = 0; j < (TWO); j++)        \
        {                                      \
            cout << XXX[i][j] << " ";          \
        }                                      \
        cout << endl;                          \
    }

typedef pair<long long int, long long int> pll;
typedef pair<long long int, pll> lpll;


const long long int mod = 998244353;
const long long int INF = 1e18;
const long double PI=3.14159265358979323; 



long long int dp[200200]={};


long long int N,Q,S[200200],T[200200],X[200200],D[200200];
set<long long int>se;
struct event{
    long long int tim,typ,Xnum;
};
bool cmp(event P,event Q){
    if(P.tim!=Q.tim){return P.tim<Q.tim;}
    else if(P.typ!=Q.typ){return P.typ<Q.typ;}
    else{return P.Xnum<Q.Xnum;}
}
event eve[400200];
int main(){
    cout << fixed << setprecision(18);
    cin>>N>>Q;
    for(long long int i = 0; i < N; i++){
        cin>>S[i]>>T[i]>>X[i];
        eve[i].tim=S[i]-X[i];
        eve[i].typ=1;
        eve[i].Xnum=X[i];

        eve[i+N].tim=T[i]-X[i];
        eve[i+N].typ=-1;
        eve[i+N].Xnum=X[i];
    }
    sort(eve,eve+2*N,cmp);
    eve[2*N].tim=INF;
    long long int now=0;
    for(long long int i = 0; i < Q; i++){
        cin>>D[i];
        while(eve[now].tim<=D[i]){
            if(eve[now].typ==1){
                se.insert(eve[now].Xnum);
            }else{
                se.erase(eve[now].Xnum);
            }
            now++;
        }
        if(se.size()==0){
            cout<<-1<<endl;
        }else{
            auto itr=se.begin();
            cout<<*itr<<endl;
        }
    }

}


Measured memory_bytes: 27008