#include <bits/stdc++.h>
using namespace std;

int main(void){
  const int inf=1<<30;
  typedef tuple<int,int,int>t3;
  int n,Q,i,cur=0,s,t,x,v;
  set<t3>q;
  scanf("%d %d",&n,&Q);vector<int> ans(Q,-1),ds(Q);
  multiset<int>ms;ms.insert(inf);
  for (i=0;i<n;i++){
    scanf("%d %d %d",&s,&t,&x);
    q.insert(make_tuple(s-x,x,1));
    q.insert(make_tuple(t-x,x,0));
  }

  for (i=0;i<Q;i++)scanf("%d",&ds[i]);

  while (!q.empty()){
    t3 e=*q.begin();q.erase(q.begin());
    tie(t,x,s)=e, v=*ms.begin();v=v!=inf?v:-1;
    while(cur<Q&&ds[cur]<t)ans[cur++]=v;
    if(s)ms.insert(x);
    else ms.erase(ms.find(x));
  }

  for (i=0;i<Q;i++)printf("%d\n",ans[i]);
  return 0;
}
