using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using static System.Math;
using static Func;
class Z { static void Main() => new K(); }
class K
{
	int F => int.Parse(Str);
	long FL => long.Parse(Str);
	int[] G => Strs.Select(int.Parse).ToArray();
	uint[] GU => Strs.Select(uint.Parse).ToArray();
	decimal[] GD => Strs.Select(decimal.Parse).ToArray();
	long[] GL => Strs.Select(long.Parse).ToArray();
	string Str => ReadLine();
	string[] Strs => Str.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
	static ulong One(int k) => 1ul << k;
	static ulong All(int k) => One(k) - 1;
	static bool Has(ulong s, int k) => (s & One(k)) != 0;
	const int MOD = 1000000007;
	public K()
	{
		SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		Out.Flush();
	}
	void Solve()
	{
		var I = G;
		int N = I[0], Q = I[1];
		var ts = MakeArray(N, _ => G);
		var qs = MakeArray(Q, _ => FL);
		var vals = new SortedSet<long>(qs);
		foreach (var t in ts)
		{
			vals.Add(t[0] - t[2]);
			vals.Add(t[1] - t[2]);
		}
		var vall = vals.ToList();
		var ind = new Dictionary<long, int>();
		for (var i = 0; i < vall.Count; i++) ind[vall[i]] = i;
		var rmq = new SegmentTree(vall.Count);
		foreach (var t in ts) rmq.Update(ind[t[0] - t[2]], ind[t[1] - t[2]], t[2]);
		foreach (var q in qs) { var ans = rmq.Min(ind[q], ind[q] + 1); WriteLine(ans >= InfL ? -1 : ans); }
	}
}
static class Func
{
	public const long InfL = 4011686018427387913L;
	public static T[] ConstantArray<T>(int n, T val) { var a = new T[n]; for (var i = 0; i < n; i++) a[i] = val; return a; }
	public static T[] MakeArray<T>(int n, Func<int, T> f) { var a = new T[n]; for (var i = 0; i < n; i++) a[i] = f(i); return a; }
	public static T[] Recurse<T>(int n, T a0, Func<int, T, T> f) { var a = new T[n]; a[0] = a0; for (var i = 1; i < n; i++) a[i] = f(i, a[i - 1]); return a; }
	public static T[] Accumulate<T>(IList<T> a, T zero, Func<T, T, T> f) { var s = new T[a.Count + 1]; s[0] = zero; for (var i = 0; i < a.Count; i++) s[i + 1] = f(s[i], a[i]); return s; }
}
class SegmentTree
{
	public const long Unit = InfL;
	int N2;
	long[] seg, unif;
	public SegmentTree(int N)
	{
		N2 = 1;
		while (N2 < N) N2 <<= 1;
		seg = ConstantArray(2 * N2 - 1, Unit);
		unif = ConstantArray(2 * N2 - 1, Unit);
	}
	void LazyEvaluate(int node)
	{
		if (unif[node] != Unit)
		{
			seg[node] = Math.Min(seg[node], unif[node]);
			if (node < N2 - 1)
			{
				unif[2 * node + 1] = Math.Min(unif[2 * node + 1], unif[node]);
				unif[2 * node + 2] = Math.Min(unif[2 * node + 2], unif[node]);
			}
			unif[node] = Unit;
		}
	}
	void Update(int node) => seg[node] = Math.Min(seg[2 * node + 1], seg[2 * node + 2]);
	public void Update(int from, int to, long value) => Update(from, to, value, 0, 0, N2);
	void Update(int from, int to, long value, int node, int l, int r)
	{
		if (from <= l && r <= to) unif[node] = Math.Min(unif[node], value);
		else if (l < to && from < r)
		{
			Update(from, to, value, 2 * node + 1, l, (l + r) >> 1);
			Update(from, to, value, 2 * node + 2, (l + r) >> 1, r);
			Update(node);
		}
		LazyEvaluate(node);
	}
	public long this[int n] { get { return Min(n, n + 1); } set { Update(n, n + 1, value - this[n]); } }
	public long Min(int from, int to) => Min(from, to, 0, 0, N2);
	long Min(int from, int to, int node, int l, int r)
	{
		LazyEvaluate(node);
		if (to <= l || r <= from) return Unit;
		if (from <= l && r <= to) return seg[node];
		return Math.Min(Min(from, to, 2 * node + 1, l, (l + r) >> 1), Min(from, to, 2 * node + 2, (l + r) >> 1, r));
	}
}


Measured memory_bytes: 125576