using System;
using System.Collections.Generic;
using System.Linq;
using static Input;

public class Prog
{
    private const int INF = 1000000007;
    private struct Pair { public int x, y; public Pair(int x, int y) { this.x = x; this.y = y; } }
    private struct Triple { public int a, b, c; public Triple(int x, int y, int z) { a = x; b = y; c = z; } }
    public static void Main()
    {
        var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        int N = NextInt();
        int Q = NextInt();
        // zip[圧縮後] = 元座標
        Dictionary<int, int> zip = new Dictionary<int, int>();
        List<int[]> stx = Enumerable.Range(0, N).Select(v => LineInt()).ToList();
        List<int[]> Event = new List<int[]>(2 * N);
        int key = 0;
        int num = -INF;
        stx.Sort((x, y) => x[2].CompareTo(y[2]));
        for (int i = 0; i < N; i++)
        {
            if (num != stx[i][2]) { zip[key] = stx[i][2]; key++; num = stx[i][2]; }
            Event.Add(new int[3] { stx[i][0] - stx[i][2], 0, key });
            Event.Add(new int[3] { stx[i][1] - stx[i][2], 1, key });
        }
        Event.Sort((x, y) => x[0].CompareTo(y[0]));
        MinTree MT = new MinTree(key + 1, 0);
        List<int> ans = new List<int>();
        int index = 0;
        foreach (var t in Enumerable.Range(0, Q).Select(v => NextInt()))
        {
            while (index < Event.Count() && t >= Event[index][0])
            {
                if (Event[index][1] == 0) MT.Add(Event[index][2], 1);
                else if (Event[index][1] == 1) MT.Add(Event[index][2], -1);
                index++;
            }
            int ind = MT.MLS(1);
            ans.Add(ind == -1 ? -1 : zip[ind - 1]);
        }
        ans.ForEach(Console.WriteLine);
        Console.Out.Flush();
    }
}

public class MinTree
{
    private List<int> table = new List<int>();
    private static int size = 1;
    private static int high = 1;
    public MinTree(int n, int k = 0)
    {
        while (size < n) size *= 2;
        high = (int)Math.Log(size, 2);
        for (int i = 0; i < 2 * size - 1; i++) table.Add(k);
    }
    public void Add(int x, int v)
    {
        x += size - 1;
        table[x] += v;
        table[x] = Math.Max(0, table[x]);
        while (x != 0)
        {
            x = (x % 2 == 0 ? x / 2 - 1 : x / 2);
            table[x] = table[x * 2 + 1] + table[x * 2 + 2];
        }
    }
    public int MLS(int k)
    {
        if (table.First() == 0) return -1;
        int index = 0;
        for (int y = 0; y < high; y++)
        {
            int left = index * 2 + 1;
            int right = index * 2 + 2;
            if (table[left] >= k) index = left;
            else { k -= table[left]; index = right; }
        }
        return index - size + 1;
    }
    public int GetValue(int k) { return table[k + size - 1]; }
}

public class Input
{
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static char NextChar() { Confirm(); return char.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}


Measured memory_bytes: 65512