import std.stdio, std.conv, std.string;
import std.array, std.range, std.algorithm, std.container;
import std.math, std.random, std.bigint, std.datetime, std.format;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

int DEBUG_LEVEL = 0;
void print()(){ writeln(""); }
void print(T, A ...)(T t, lazy A a){ write(t), print(a); }
void print(int level, T, A ...)(T t, lazy A a){ if(level <= DEBUG_LEVEL) print(t, a); }

void main(string[] args){
	if(args.length > 1 && args[1] == "-debug"){
		if(args.length > 2 && args[2].isNumeric) DEBUG_LEVEL = args[2].to!int;
		else DEBUG_LEVEL = 1;
	}
	
	int n = read.to!int;
	int q = read.to!int;
	
	X[] xs;
	foreach(i; 0 .. n){
		xs ~= new X(read.to!long, read.to!long, read.to!long);
	}
	
	xs.sort!"a.x>b.x"();
	
	long[] ds;
	foreach(k; 0 .. q) ds ~= read.to!long;
	ds ~= 2_000_000_000;
	// dsは初めからソートされている
	print!1("ds:", ds);
	
	SegTree seg = new SegTree(0, q + 1);
	seg.setValue(0, q + 1, -1);
	print!1("seg:", seg);
	
	foreach(x; xs){
		long l = x.s - x.x;
		long r = x.t - x.x;
		
		int il = uplimit(0, q, (int i) => ds[i] < l) + 1;
		int ir = uplimit(0, q, (int i) => ds[i] < r) + 1;
		
		seg.setValue(il, ir, x.x);
		print!1("x:", [x.s, x.t, x.x], " l:", l, " r:", r, " il:", il, " ir:", ir, " seg:", seg);
	}
	
	foreach(k; 0 .. q) seg.getValue(k).writeln;
	
}

class X{
	long s, t, x;
	this(long s, long t, long x){
		this.s = s;
		this.t = t;
		this.x = x;
	}
}


/*
座圧してセグメント木



*/

// 区分木(区間への書き込み、1点の読み出し)
class SegTree{
	long value;
	SegTree left, right; // 左の子(a <= x < c)、右の子(c <= x < b)
	bool hasValue;
	bool isTerminal;
	SegTree parent;
	int a, b; // a <= x < b を担当する
	this(int a, int b){
		this.a = a, this.b = b;
		if(b - a == 1){
			this.isTerminal = 1;
		}
		else{
			int c = (a + b) / 2;
			this.left = new SegTree(a, c);
			this.right = new SegTree(c, b);
		}
	}
	
	// [a, b) に値を設定する ※[a, b) はこのノードの担当区間とかぶっていなくてもよい
	void setValue(int a, int b, long value){
		if(b <= this.a || this.b <= a) return;
		if(a <= this.a && this.b <= b){
			this.hasValue = 1;
			this.value = value;
		}
		else{
			if(this.hasValue){
				this.hasValue = 0;
				this.left.hasValue = 1, this.left.value = this.value;
				this.right.hasValue = 1, this.right.value = this.value;
			}
			this.left.setValue(a, b, value);
			this.right.setValue(a, b, value);
		}
	}
	
	// iにおける値 ※iは必ずこのノードの担当区間内である前提
	long getValue(int i){
		if(this.hasValue) return this.value;
		if(i < left.b) return left.getValue(i);
		else return right.getValue(i);
	}
	
	long[] array(){
		if(this.hasValue){
			long[] res;
			foreach(i; a .. b) res ~= this.value;
			return res;
		}
		else return this.left.array ~ this.right.array;
	}
	
	override string toString(){
		return this.array.to!string;
	}
}

// a <= x <=  c の中でfをみたす最大(二分探索; binary search) ※テンプレート版
T uplimit(T)(T a, T c, bool delegate(T) f){
	if(f(c)) return c;
	if(! f(a)) return a - 1;
	while(a + 1 < c){
		T b = (a + c) / 2;
		if(f(b)) a = b;
		else c = b;
	}
	return a;
}
