using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive
{
    internal class Solution
    {
        public int N, Q;
        public long MOD = 1000000007;
        public int[] S, T, X, D, D2;

        public void Run()
        {
            {
                var line = Input.ReadIntArray();
                N = line[0];
                Q = line[1];
            }

            S = new int[N];
            T = new int[N];
            X = new int[N];
            Data[] DD = new Data[N];
            for (int i = 0; i < N; i++)
            {
                var line = Input.ReadIntArray();
                S[i] = line[0];
                T[i] = line[1];
                X[i] = line[2];
                DD[i] = new Data(S[i], T[i], X[i]);
            }

            Array.Sort(DD, Data.CompareTo);

            D = new int[Q];
            for (int q = 0; q < Q; q++)
            {
                D[q] = Input.ReadInt();
            }

            BinarySearch bs1 = new BinarySearch(D);
            SegTree tree = new SegTree(Q);
            tree.Update(0, Q, N);

            for (int i = N - 1; i >= 0; i--)
            {
                // S - X
                int left = bs1.Search(DD[i].S - DD[i].X);
                int right = bs1.Search(DD[i].T - DD[i].X);

                // 更新する
                tree.Update(left, right, i);
            }

            for (int q = 0; q < Q; q++)
            {
                int i = tree.Query(q);
                if(i == N) Console.WriteLine(-1);
                else Console.WriteLine(DD[i].X);
            }
        }
    }

    // libs ----------
    class Data
    {
        public int S;
        public int T;
        public int X;

        public Data(int s, int t, int x)
        {
            this.S = s;
            this.T = t;
            this.X = x;
        }

        // SortするときのComparerは明示的に指定する
        public static int CompareTo(Data d1, Data d2)
        {
            int result = d1.X.CompareTo(d2.X);
            return result;
        }
    }

    internal class BinarySearch
    {
        public int[] S;
        public int N { get { return S.Length; } }

        public BinarySearch(int[] s)
        {
            S = s;
        }

        // 左側がfalse, 右側がtrueである必要がある
        public bool Cond(int i, int x)
        {
            if (S[i] >= x) return true;
            return false;
        }

        // 初めてCondがtrueを返すindexを返す
        // 全て条件を満たさない場合はNを返す
        public int Search(int x)
        {
            int left = 0;
            int right = N;

            if (Cond(0, x)) return 0;
            if (!Cond(N - 1, x)) return N;

            while (left + 1 < right)
            {
                int mid = (left + right) / 2;
                if (!Cond(mid, x))
                {
                    left = mid;
                }
                else
                {
                    right = mid;
                }
            }
            return right;
        }
    }

    internal class SegTree
    {
        // TODO: Debug

        public int N;
        public int NCells;
        public int[] Data;
        public int[] KL; // 範囲のbegin
        public int[] KR; // 範囲のend（そのセルは含まない）
        public const int Dummy = 2147483647; // 2^31-1

        public SegTree(int _n)
        {
            Init(_n);
        }

        private int GetN(int _n)
        {
            int n = 1;
            while (n < _n) n *= 2;
            return n;
        }

        private void Init(int _n, int initialValue = Dummy)
        {
            N = GetN(_n);
            NCells = 2 * N - 1;

            Data = new int[NCells];
            KL = new int[NCells];
            KR = new int[NCells];

            // KL, KRの初期化
            for (int k = 0; k < NCells; k++)
            {
                if (IsRoot(k))
                {
                    KL[k] = 0;
                    KR[k] = N;
                }
                else
                {
                    if (IsChildL(k))
                    {
                        KL[k] = KL[Parent(k)];
                        KR[k] = (KL[Parent(k)] + KR[Parent(k)]) / 2;
                    }
                    else
                    {
                        KL[k] = (KL[Parent(k)] + KR[Parent(k)]) / 2;
                        KR[k] = KR[Parent(k)];
                    }
                }
            }

            // 値の初期化
            for (int k = 0; k < NCells; k++) Data[k] = initialValue;

        }

        // i番目のみの値を保持するセル
        public int Pos(int i) { return i + N - 1; }

        // 親セル・子セル
        public int Parent(int k) { return (k - 1) / 2; }
        public int ChildL(int k) { return k * 2 + 1; }
        public int ChildR(int k) { return k * 2 + 2; }

        // 根かどうか
        public bool IsRoot(int k) { return k == 0; }

        // 左側の子かどうか
        public bool IsChildL(int k)
        {
            if (IsRoot(k)) return false;
            return ChildL(Parent(k)) == k;
        }

        // Update - top down
        public void Update(int il, int ir, int a)
        {
            update(il, ir, 0, a);
        }

        private void update(int il, int ir, int k, int a)
        {
            int kl = KL[k];
            int kr = KR[k];

            // [Query Logic]
            if (kr <= il || ir <= kl) return;
            if (il <= kl && kr <= ir) Data[k] = a;
            else
            {
                if (Data[k] != Dummy)
                {
                    Data[ChildL(k)] = Data[k];
                    Data[ChildR(k)] = Data[k];
                    Data[k] = Dummy;
                }
                update(il, ir, ChildL(k), a);
                update(il, ir, ChildR(k), a);
            }
        }

        // Update - bottom up
        public int Query(int i)
        {
            int k = Pos(i);
            int v = Data[k];
            while (!IsRoot(k))
            {
                // Update Logic
                k = Parent(k);
                if (Data[k] != Dummy)
                    v = Data[k];
            }

            return v;
        }

    }

    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

Measured memory_bytes: 35028