/***********************************************************
 *This code By @1353055672(Ligen)                          *
 *[Warning]You're not excepted to understand this code!    *
 *NOIP 2019 RP++                                      *
 ***********************************************************/
#pragma GCC optimize(3)
#define ADD_STACK int size = 512 << 20;\
    char *p = (char*)malloc(size) + size;  \
    __asm__("movl %0, %%esp\n" :: "r"(p))
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<stack>
#include<set>
#include<bitset>
#include<ctime>
#include<vector>
#define ll long long
#define int ll
#define ull unsigned long long
#define mn 200020
#define Max(x,y) ((x>y)?x:y)
#define Min(x,y) ((x<y)?x:y)
#define Abs(x) (((x)<(0))?(-(x)):(x))
#define infll (ll)(1e18)
#define infint (int)(1<<30)
#define mod (int)(19260817)
#define FOR(a,b,c) for (register int a=b;a<=c;a++)
#define FORD(a,b,c) for (register int a=b;a>=c;a--)
using namespace std;
//char buf[1<<20],*p1=buf,*p2=buf;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
inline int read(){
    int x=0,f=1;char c;
    for(c=getchar();c<'0'||c>'9';f=((c=='-')?-1:f),c=getchar());
    for(;c>='0'&&c<='9';x=x*10+c-'0',c=getchar());return x*f;
}
template<typename T>
inline void write(T a){
    if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
    while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
}
inline void write_(){return;}
template<typename T,typename... Args>
inline void write_(T a,Args... b){write(a);putchar(' ');write_(b...);}
inline void writeln(){putchar('\n');return;}
template<typename T,typename... Args>
inline void writeln(T a,Args... b){write(a);putchar(' ');writeln(b...);}
//need c++11

//inline void write(ll a){
//    if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
//    while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
//}
//inline void write_(ll a){write(a);putchar(' ');}
//inline void writeln(ll a){write(a);putchar('\n');}
inline ll gcd(ll a,ll b){return a==0?b:gcd(b%a,a);}
inline ll lcm(ll a,ll b){return 1ll*a/gcd(a,b)*b;}
inline ll Pow(ll n,ll a){ll b=1;while(a){if(a&1)b=1ll*b*n%mod;n=1ll*n*n%mod;a>>=1;}return b;}
//---------------------Head Files--------------------------//
struct sgt{
	#define MN 20000020
	int mi[MN],f[MN],ls[MN],rs[MN],tot;
	inline void build(){
		memset(f,0x7f7f7f7f,sizeof(f));
		memset(mi,0x7f7f7f7f,sizeof(mi));
	}
	inline void Down(int h){
		if(f[h]){
			if(ls[h])mi[ls[h]]=Min(mi[ls[h]],f[h]),f[ls[h]]=Min(f[ls[h]],f[h]);
			else ls[h]=++tot,mi[ls[h]]=f[ls[h]]=f[h];
			if(rs[h])mi[rs[h]]=Min(mi[rs[h]],f[h]),f[rs[h]]=Min(f[rs[h]],f[h]);
			else rs[h]=++tot,mi[rs[h]]=f[rs[h]]=f[h];
			f[h]=0x7f7f7f7f;
		}
	}
	inline void add(int x,int y,int c,int l,int r,int &h){
		if(!h)h=++tot;
		if(x<=l&&r<=y){if(c<mi[h]||!mi[h])mi[h]=f[h]=c;return;}
		Down(h);int mid=(l+r)>>1;
		if(x<=mid)add(x,y,c,l,mid,ls[h]);
		if(y>mid)add(x,y,c,mid+1,r,rs[h]);
	}
	inline int ask(int x,int l,int r,int h){
//		writeln(x,l,r,h,mi[h]);
		if(l==r)return mi[h];
		Down(h);
		int mid=(l+r)>>1;
		if(x<=mid)return ask(x,l,mid,ls[h]);
		return ask(x,mid+1,r,rs[h]);
	}
}T;
int n,m,s,t,x,rt;
signed main(){
//	freopen("0.in","r",stdin);
	#define N (1000000010)
    n=read(),m=read();T.build();
//    writeln((long long)(0x7f7f7f7f));
    FOR(i,1,n){
    	s=read(),t=read(),x=read();
    	s=Max(s,x);--t;
    	s-=x;t-=x;
    	if(s<=t){
    		++s,++t;
    		T.add(s,t,x,1,N,rt);
    	}
    }
    int ans=0;
    FOR(i,1,m){
    	x=read();++x;
    	ans=T.ask(x,1,N,rt);
    	if(ans>=0x7f7f7f7f)puts("-1");else 
		writeln(ans);
    }
    return 0;
}


Measured memory_bytes: 511360