using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;

namespace AtCoder_Beginner_Contest_128
{
    class Program
    {
        public struct Pair
        {
            public long T;
            public long E;
            public long X;
            public Pair(long t, long e, long x) { T = t; E = e; X = x; }
        }
        static public int[] SIn() { return ReadLine().Split().Select(int.Parse).ToArray(); }
        static public string[] SInS() { return ReadLine().Split().ToArray(); }
        static void Main(string[] args)
        {
            var NQ = SIn();
            var N = NQ[0];
            var Q = NQ[1];
            var start = new long[N];
            var end = new long[N];
            var stx = new List<Pair>(2 * N);
            for (var i = 0; i < N; ++i)
            {
                var STX = SIn();
                stx.Add(new Pair(STX[0] - STX[2], 1, STX[2]));
                stx.Add(new Pair(STX[1] - STX[2], -1, STX[2]));
            }
            var orderd = stx.OrderBy(st => st.T).ToArray();
            var Di = new long[Q];
            var dst = new long[Q];
            for(var i=0;i<Q;++i)
            {
                Di[i] = SIn()[0];
                dst[i] = -1;
            }
            var Kouji = new SortedDictionary<long, long>();//x,なんでもいい
            int dcnt = 0;
            for (var i = 0; i < orderd.Length; ++i)
            {
                while (dcnt < Q && Di[dcnt] < orderd[i].T)
                {
                    if (0 != Kouji.Count)
                    { dst[dcnt] = Kouji.Keys.First(); }
                    ++dcnt;
                }
                if (orderd[i].E == 1)
                { Kouji[orderd[i].X] = 1; }
                else
                { Kouji.Remove(orderd[i].X); }
            }
            foreach (var d in dst)
            { WriteLine(d); }
        }
    }
}
