using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using Debug;
//using static System.Globalization.CultureInfo;
//using Edge = Pair<long, int>;
using System.Text;
class Program
{ 
    static void Main(string[] args)
    {
        Solve();
        //WriteLine(Solve());
    }
    static int[] nq;
    static Dictionary<int, List<int[]>> dic;
    static int[] keys;
    static int qu;
    static void Solve()
    {
        var nq = Input.ar;
        var stx = Input.ar2D(nq[0]);
        for(var i=0;i<nq[0];i++)
        {
            stx[i][0] -= stx[i][2];
            stx[i][1] -= stx[i][2];
        }
        stx = stx.OrderBy(v => v[2]).ToArray();
        var ds = Input.ar1D(nq[1]);
        var bit = new SegmentTree<int>(nq[1], int.MaxValue, (a, b) => Min(a, b),(a,b)=>Min(a,b));
        for(var i = 0; i < nq[0]; i++)
        {
            var ind = Search.LowerBound(ds, stx[i][0]);
            var ind2 = Search.LowerBound(ds, stx[i][1]);
            bit.Update(ind, ind2, stx[i][2]);
        }
        var res = new List<int>(nq[1]);
        for (var j = 0; j < nq[1]; j++)
            res.Add(bit.Query(j));

        WriteLine(string.Join("\n", res.Select(v=>v==int.MaxValue?-1:v)));
           
    }
}

public class Input
{
    public static string read => ReadLine().Trim();
    public static int[] ar => read.Split(' ').Select(int.Parse).ToArray();
    public  static int num => ToInt32(read);
    public static long[] arL => read.Split(' ').Select(long.Parse).ToArray();
    public  static long numL => ToInt64(read);
    public static char[][] gred(int h) 
        => Enumerable.Repeat(0, h).Select(_ => read.ToCharArray()).ToArray();
    public static int[] ar1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => num).ToArray();
    public static long[] arL1D(int n)
        => Enumerable.Repeat(0, n).Select(_ => numL).ToArray();
    public static int[][] ar2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => ar).ToArray();
    public static long[][] arL2D(int n)
        => Enumerable.Repeat(0, n).Select(_ => arL).ToArray();
    public static T getValue<T>(string g)
    {
        var t = typeof(T);
        if (t == typeof(int))
            return (T)(object)int.Parse(g);
        if (t == typeof(long))
            return (T)(object)long.Parse(g);
        if (t == typeof(string))
            return (T)(object)g;
        if (t == typeof(char))
            return (T)(object)char.Parse(g);
        if (t == typeof(double))
            return (T)(object)double.Parse(g);
        if (t == typeof(bool))
            return (T)(object)bool.Parse(g);
        return default(T);
    }
    public const long Inf = (long)1e18;
    public const double eps = 1e-6;
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}

public class Search
{
    public static int UpperBound<T>(IList<T> array,T value)
        where T : IComparable<T>
    {
        var low = 0;
        var high = array.Count;
        while (high > low)
        {
            var mid = (high + low) / 2;
            if (array[mid].CompareTo(value) == 1) high = mid;
            else low = mid + 1;
        }
        return low;
    }
    
    public static int LowerBound<T>(IList<T> array,T value)
        where T : IComparable<T>
    {
        var low = 0;
        var high = array.Count;
        while (high > low)
        {
            var mid = (high + low) / 2;
            if (array[mid].CompareTo(value) != -1) high = mid;
            else low = mid + 1;
        }
        return low;
    }

    public static T Max<T>(params T[] array)
        => array.Max();
    public static T Min<T>(params T[] array)
        => array.Min();
    public static bool Inside(int h, int w, int[] hw)
        => 0 <= h && h < hw[0] && 0 <= w && w < hw[1];
    public static bool IsPrime(long num)
    {
        if (num % 2 == 0 || num == 1) return num == 2;
        for (var i = 3L; i * i <= num; i += 2)
            if (num % i == 0) return false;
        return true;
    }

}

public class SegmentTree<T>
{
    private readonly T[] item;
    private readonly int _num;
    private readonly Func<T, T, T> _func;
    private readonly Func<T, T, T> updateFunc;
    private readonly T _init;

    private int Parent(int index)
        => (index - 1) >> 1;
    private int Left(int index)
        => (index << 1) + 1;
    private int Right(int index)
        => (index + 1) << 1;
    public T this[int i]
    {
        get { return item[i + _num - 1]; }
        set { item[i + _num - 1] = value; }
    }

    public SegmentTree(int num, T init, Func<T, T, T> func, Func<T, T, T> updateFunc = null)
    {
        _func = func;
        _num = 1;
        _init = init;
        this.updateFunc = updateFunc ?? ((T val1, T val2) => val2);
        while (_num <= num)
            _num *= 2;
        item = new T[2 * _num - 1];
        for (var i = 0; i < 2 * _num - 1; i++)
            item[i] = init;
    }
    public void Update(int index, T value)
    {
        index += _num - 1;
        item[index] = updateFunc(item[index], value);
        while (index > 0)
        {
            index = Parent(index);
            item[index] = _func(item[Left(index)], item[Right(index)]);
        }
    }
    public void Update(int left, int right, T value)
        => Update(left, right, 0, 0, _num, value);
    private void Update(int left, int right, int k, int l, int r, T value)
    {
        if (r <= left || right <= l) return;
        if (left <= l && r <= right) item[k] = updateFunc(item[k], value);
        else
        {
            Update(left, right, Left(k), l, (l + r) >> 1, value);
            Update(left, right, Right(k), (l + r) >> 1, r, value);
        }
    }
    public void All_Update()
    {
        for (int i = _num - 2; i >= 0; i--)
            item[i] = _func(item[Left(i)], item[Right(i)]);
    }
    public T Query(int index)
    {
        index += _num - 1;
        var value = _func(_init, item[index]);
        while (index > 0)
        {
            index = Parent(index);
            value = _func(value, item[index]);
        }
        return value;
    }
    //[left,right)
    public T Query(int left, int right)
        => Query(left, right, 0, 0, _num);
    private T Query(int left, int right, int k, int l, int r)
    {
        if (r <= left || right <= l) return _init;
        if (left <= l && r <= right) return item[k];
        else
            return _func(Query(left, right, Left(k), l, (l + r) / 2), Query(left, right, Right(k), (l + r) / 2, r));
    }
}


Measured memory_bytes: 47252