using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }
        private const int MOD = 1000000007;
        public class Event
        {
            public int t;
            public bool cmd;
            public int x;
            public Event(int t, bool cmd, int x)
            {
                this.t = t;
                this.cmd = cmd;
                this.x = x;
            }
        };
        static void Solve()
        {
            var n = Input.NextInt();
            var q = Input.NextInt();
            var list = new List<Event>(n * 2);

            for (int i = 0; i < n; ++i)
            {
                var s = Input.NextInt();
                var t = Input.NextInt();
                var x = Input.NextInt();
                list.Add(new Event(s - x, true, x));
                list.Add(new Event(t - x, false, x));

            }
            var d = Input.NextInt(q);

            list = list.OrderBy(a => a.t).ToList();
            var map = new SortedSet<int>();

            int idx = 0;
            var ans = new List<int>(q);
            foreach (var di in d)
            {
                while (idx < list.Count)
                {
                    var e = list[idx];
                    if (e.t > di) { break; }
                    if (e.cmd)
                    {
                        map.Add(e.x);
                    }
                    else
                    {
                        map.Remove(e.x);
                    }
                    idx++;
                }
                if (map.Any())
                {

                    ans.Add(map.First());
                }
                else
                {
                    ans.Add(-1);
                }
            }
            foreach (var ansi in ans)
            {
                Console.WriteLine(ansi);
            }
        }
        static class Input
        {
            static char[] separator = { ' ' };
            public static bool IsEof { get; set; }
            static Queue<string> q { get; set; }

            static Input()
            {
                IsEof = false;
                q = new Queue<string>();
            }

            /// <summary>
            /// 入力予約
            /// </summary>
            /// <param name="items"></param>
            public static void SetText(IEnumerable<string> items)
            {
                foreach (var item in items)
                {
                    SetText(item);
                }
            }

            /// <summary>
            /// 入力予約
            /// </summary>
            /// <param name="s"></param>
            /// <returns></returns>
            public static bool SetText(string s)
            {
                if (s == null) return false;

                foreach (var elem in s.Trim().Split(separator, StringSplitOptions.RemoveEmptyEntries))
                {
                    q.Enqueue(elem);
                }

                return true;
            }

            /// <summary>
            /// 内部queueに入力からの値をsplitして格納する
            /// </summary>
            /// <returns></returns>
            static bool read()
            {
                var s = Console.ReadLine();
                if (s == null) return false;

                foreach (var elem in s.Trim().Split(separator, StringSplitOptions.RemoveEmptyEntries))
                {
                    q.Enqueue(elem);
                }

                if (!q.Any()) return read();

                return true;
            }

            /// <summary>
            /// 次のstringを一つ読み込む
            /// </summary>
            /// <returns></returns>
            public static string Next()
            {
                if (!q.Any())
                {
                    if (!read())
                    {
                        IsEof = true;
                        return "";
                    }
                }

                return q.Dequeue();
            }

            public static int NextInt() => int.Parse(Next());
            public static long NextLong() => long.Parse(Next());
            public static double NextDouble() => double.Parse(Next());

            public static List<string> Next(int n) => Enumerable.Range(0, n).Select(_ => Next()).ToList();
            public static List<int> NextInt(int n) => Next(n).Select(x => int.Parse(x)).ToList();
            public static List<long> NextLong(int n) => Next(n).Select(x => long.Parse(x)).ToList();
            public static List<double> NextDouble(int n) => Next(n).Select(x => double.Parse(x)).ToList();

            public static List<string> NextLine() => Console.ReadLine().Trim().Split(separator, StringSplitOptions.RemoveEmptyEntries).ToList();
            public static List<int> NextIntLine() => NextLine().Select(x => int.Parse(x)).ToList();
            public static List<long> NextLongLine() => NextLine().Select(x => long.Parse(x)).ToList();
            public static List<double> NextDoubleLine() => NextLine().Select(x => double.Parse(x)).ToList();
        }

    }
}


Measured memory_bytes: 59684