using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.Abc128
{
    class E
    {
        public static void Main()
        {
            (int n, int q) = Reader.NextInt2();
            var list = new List<(int, int, int)>();
            for (int i = 0; i < n; i++)
            {
                (int s, int t, int x) = Reader.NextInt3();
                if (t < x)
                    continue;
                list.Add((t - x, 0, x));
                list.Add((s - x, 1, x));
            }
            for (int i = 0; i < q; i++)
            {
                int d = Reader.NextInt();
                list.Add((d, 2, i));
            }

            list.Sort((a, b) => a.Item1 != b.Item1 ? a.Item1 - b.Item1 : a.Item2 - b.Item2);

            var dict = new SortedSet<int>();
            var ans = Enumerable.Repeat(-1, q).ToArray();
            foreach ((int _, int type, int key) in list)
            {
                switch (type)
                {
                    case 0:
                        dict.Remove(key);
                        break;
                    case 1:
                        dict.Add(key);
                        break;
                    default:
                        if (dict.Any())
                            ans[key] = dict.First();
                        break;
                }
            }

            Writer.Suspend();
            foreach (var item in ans)
                Console.WriteLine(item);
            Writer.Flush();
        }
    }


    static class Reader
    {
        public static string NextString() => Console.ReadLine();

        public static int NextInt() => int.Parse(Console.ReadLine());
        public static (int, int) NextInt2()
        {
            var array = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            return (array[0], array[1]);
        }
        public static (int, int, int) NextInt3()
        {
            var array = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            return (array[0], array[1], array[2]);
        }
        public static (int, int, int, int) NextInt4()
        {
            var array = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            return (array[0], array[1], array[2], array[3]);
        }
        public static (int, int, int, int, int) NextInt5()
        {
            var array = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            return (array[0], array[1], array[2], array[3], array[4]);
        }
        public static (int, int, int, int, int, int) NextInt6()
        {
            var array = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            return (array[0], array[1], array[2], array[3], array[4], array[5]);
        }

        public static long NextLong() => long.Parse(Console.ReadLine());
        public static (long, long) NextLong2()
        {
            var array = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            return (array[0], array[1]);
        }
        public static (long, long, long) NextLong3()
        {
            var array = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            return (array[0], array[1], array[2]);
        }
        public static (long, long, long, long) NextLong4()
        {
            var array = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            return (array[0], array[1], array[2], array[3]);
        }
        public static (long, long, long, long, long) NextLong5()
        {
            var array = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            return (array[0], array[1], array[2], array[3], array[4]);
        }
        public static (long, long, long, long, long, long) NextLong6()
        {
            var array = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            return (array[0], array[1], array[2], array[3], array[4], array[5]);
        }

        public static double NextDouble() => double.Parse(Console.ReadLine());
        public static (double, double) NextDouble2()
        {
            var array = Console.ReadLine().Split(' ').Select(x => double.Parse(x)).ToArray();
            return (array[0], array[1]);
        }
        public static (double, double, double) NextDouble3()
        {
            var array = Console.ReadLine().Split(' ').Select(x => double.Parse(x)).ToArray();
            return (array[0], array[1], array[2]);
        }
        public static (double, double, double, double) NextDouble4()
        {
            var array = Console.ReadLine().Split(' ').Select(x => double.Parse(x)).ToArray();
            return (array[0], array[1], array[2], array[3]);
        }
        public static (double, double, double, double, double) NextDouble5()
        {
            var array = Console.ReadLine().Split(' ').Select(x => double.Parse(x)).ToArray();
            return (array[0], array[1], array[2], array[3], array[4]);
        }
        public static (double, double, double, double, double, double) NextDouble6()
        {
            var array = Console.ReadLine().Split(' ').Select(x => double.Parse(x)).ToArray();
            return (array[0], array[1], array[2], array[3], array[4], array[5]);
        }
        public static double[] NextDoubleArray() => Console.ReadLine().Split(' ').Select(x => double.Parse(x)).ToArray();
    }

    static class Writer
    {
        public static void Suspend() => Console.SetOut(new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });

        public static void Flush() => Console.Out.Flush();
    }
}


Measured memory_bytes: 81132