#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <math.h>

typedef long long ll;
typedef long double ld;
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define PRECISION std::cout << std::fixed << std::setprecision(20);
  
using namespace std;
 
const int inf = 2e9+1;
const ll N = 2e5+1;
const ll mod = 1e9+7;

ll tree[4*N],lazy[4*N],arr[N],pos[N],perm[N];

void build(int ss,int se,int si){
 
    if(ss==se){
        tree[si] = inf;    
        return;
    }
    int mid = (ss+se)/2;
    build(ss,mid,2*si+1);
    build(mid+1,se,2*si+2);
    tree[si] = min(tree[2*si+1],tree[2*si+2]);
}


void pushdown(int si,int ss,int se){
    if(lazy[si]){
      tree[si] = min(lazy[si],tree[si]);
      if(ss!=se){
          if(lazy[2*si+1]){
            lazy[2*si+1] = min(lazy[si],lazy[2*si+1]);
          }else{
              lazy[2*si+1] = lazy[si];
          }

          if(lazy[2*si+2]){
            lazy[2*si+2] = min(lazy[si],lazy[2*si+2]);
          }else{
              lazy[2*si+2] = lazy[si];
          }
      }
      lazy[si]=0;
   }
}

 
ll query(int qs,int qe,int ss,int se,int si){
    
    pushdown(si,ss,se);
    if(qs>se || qe<ss){
       return inf;
    }


    if(ss>=qs && se<=qe){
        // cout<<"here\n";
        // cout<<ss<<" "<<se<<" "<<tree[si]<<"\n";
       return tree[si];
    }

    int mid = (se+ss)/2;
    return min(query(qs,qe,ss,mid,2*si+1),query(qs,qe,mid+1,se,2*si+2));
}

void upd(int qs,int qe,int ss,int se,int si,int v){

    pushdown(si,ss,se);
    if(qs>se || qe<ss || qs>qe){
       return;
    }

    // cout<<qs<<" "<<qe<<" "<<ss<<" "<<se<<" "<<si<<" ";
    // cout<<qs<<" "<<qe<<" "<<ss<<" "<<se<<" "<<si<<" "<<v<<"\n";

    if(ss>=qs && se<=qe){
        lazy[si]=v;
        pushdown(si,ss,se);
        // cout<<qs<<" "<<qe<<" "<<ss<<" "<<se<<" "<<si<<" ";
        // cout<<tree[si]<<"\n";
        return;
    }

    int mid = (se+ss)/2;

    upd(qs,qe,ss,mid,2*si+1,v);
    upd(qs,qe,mid+1,se,2*si+2,v);
    tree[si] = min(tree[2*si+1],tree[2*si+2]);
    // cout<<qs<<" "<<qe<<" "<<ss<<" "<<se<<" "<<si<<" ";

    // cout<<tree[si]<<"\n";
}

int main(){

    FASTIO;
    PRECISION;

    int n,q;
    cin>>n>>q;
    vector<int>d(q);
    vector<array<int,3>>store(n);
    vector<int>od(q);
    for(auto &x: store){
        for(auto &y: x){
            cin>>y;
        }
    }
    for(int i=0;i<q;i++){
        cin>>d[i];
        od[i]=d[i];
    }

    build(0,q,0);

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

    map<int,int>mp;
    int cntr = 0;
    for(auto temp: store){
        // if(cntr==0){
        //     cntr++;
        //     continue;
        // }
        int s = temp[0], t = temp[1], x = temp[2];
        int p1 = lower_bound(d.begin(),d.end(),s-x)-d.begin();
        int p2 = upper_bound(d.begin(),d.end(),t-1-x)-d.begin();

        // cout<<s<<" "<<t<<" "<<x<<" "<<p1<<" "<<p2-1<<"\n";
        // for(int i=p1;i<p2;i++){
        //     cout<<d[i]+x<<" ";
        // }
        // cout<<"\n";
        
        upd(p1,p2-1,0,q,0,x);

        // for(int i=p1;i<p2;i++){
        //     cout<<query(i,i,0,q,0)<<" ";
        // }
        // cout<<"\n";
        // query(p1,p2,0,n,0);
    }

    for(int i=0;i<q;i++){
        int ans = query(i,i,0,q,0);
        mp[d[i]] = ans;
    }

    for(int i=0;i<q;i++){
        int ans = mp[od[i]];

        if(ans==inf){
            cout<<-1<<"\n";
        }else{
            cout<<ans<<"\n";
        }
    }


}


Measured memory_bytes: 27520