using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
static class Ex{
	public static int LowerBound<T>  (this IList<T> a, T v) where T:IComparable<T> {
		if(a[0].CompareTo(v) >= 0) return 0;
		int l = 0, r = a.Count;
		while(r - l > 1){
			int c = (r + l) / 2;
			if(a[c].CompareTo(v) < 0) l = c;
			else r = c;
		}
		return r;
	}
	public static int UpperBound<T>  (this IList<T> a, T v) where T:IComparable<T> {
		if(a[0].CompareTo(v) > 0) return 0;
		int l = 0, r = a.Count;
		while(r - l > 1){
			int c = (r + l) / 2;
			if(a[c].CompareTo(v) <= 0) l = c;
			else r = c;
		}
		return r;
	}
}


class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		long Inf = (long) 1e18;
		var hs = new HashSet<long>();
		hs.Add(-Inf);
		hs.Add(Inf);
		for(int i=0;i<N;i++){
			hs.Add(S[i] - X[i]);
			hs.Add(T[i] - X[i] - 1);
			hs.Add(T[i] - X[i]);
		}
		for(int i=0;i<Q;i++){
			hs.Add(D[i]);
		}
		
		var di = new Dictionary<long, int>();
		var l = hs.ToList();
		l.Sort();
		for(int i=0;i<l.Count;i++) di.Add(l[i], i);
		
		int M = l.Count;
		var ST = new SegTreeMin(M + 2);
		for(int i=0;i<N;i++){
			int lidx = di[S[i] - X[i]];
			int ridx = di[T[i] - X[i] - 1];
			ST.UpdateRange(lidx, ridx + 1, X[i]);
		}
		
		
		long[] ans = new long[Q];
		for(int i=0;i<Q;i++){
			int didx = di[D[i]];
			var v = ST.At(didx);
			ans[i] = v == Inf ? -1 : v;
		}
		
		Console.WriteLine(String.Join("\n",ans));
		
		
	}
	int N,Q;
	long[] S,T,X;
	long[] D;
	public Sol(){
		var d = ria();
		N = d[0]; Q = d[1];
		S = new long[N];
		T = new long[N];
		X = new long[N];
		for(int i=0;i<N;i++){
			var dd = rla();
			S[i] = dd[0]; T[i] = dd[1]; X[i] = dd[2];
		}
		D = new long[Q];
		for(int i=0;i<Q;i++) D[i] = rl();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}



class SegTreeMin{
	//segment Tree 
	// 0-origin
	protected long[] Data;	
	protected long Inf;	
	protected int N;		
	protected int n;		
	
	public SegTreeMin(int n_){
		N = n_; Inf = (long)1e18;
		n = 1;
		while(n < n_) n *= 2;
		Data = new long[2 * n - 1];
		for(int i=0; i < 2 * n - 1; i++) Data[i] = Inf;
	}
	
	//	   0
	//	 1   2
	//	3 4 5 6
	public void Update(int k,long a){
		k+=n-1;	
		Data[k]=a;
		while(k>0){
			k=(k-1)/2;
			Data[k]=Math.Min(Data[k*2+1],Data[k*2+2]);
		}
	}
	public void UpdateRange(int a, int b, long v){
		UpdateRange(a, b, 0, 0, n, v);
	}
	public void UpdateRange(int a,int b,int k,int l,int r, long v){
//Console.WriteLine("a;{0} b:{1} k:{2}, l:{3}, r;{4}, v:{5}: n {6}",a,b,k,l,r,v,n);
		if(r <= a || b <= l) return ;
		if(a <= l && r <= b) {Data[k] = Math.Min(Data[k], v); return;}
		
		UpdateRange(a, b, k * 2 + 1, l, (l + r) / 2, v);
		UpdateRange(a ,b, k * 2 + 2, (l + r) / 2, r, v);
	}
	
	public long At(int k){
		k += n - 1;
		long ret = Data[k];
		while(k>0){
			k=(k-1)/2;
			ret = Math.Min(ret, Data[k]);
		}
		return ret;
	}
	
	public long QueryMin(int a, int b){
		return Query(a, b, 0, 0, n);
	}
	//RMQ; [a,b)
	public long Query(int a,int b,int k,int l,int r){
		if(r <= a || b <= l) return Inf;
		if(a <= l && r <= b) return Data[k];
		
		var vl = Query(a, b, k * 2 + 1, l, (l + r) / 2);
		var vr = Query(a ,b, k * 2 + 2, (l + r) / 2, r);
		return Math.Min(vl, vr);
	}
	
	
	public long Min{
		get{ return Data[0];}
	}
	
	
	public void Dump(){
		Console.WriteLine();
		int h = 0;
		int cnt = 0;
		for(int i=0;i<Data.Length;i++){
			Console.Write("{0} ", Data[i]);
			cnt++;
			if(cnt == 1 << h){
				cnt = 0;
				h++;
				Console.WriteLine();
			}
		}
	}
	
}



Measured memory_bytes: 122504