#include <bits/stdc++.h>
using namespace std;
typedef long long int llint;
typedef unsigned long long int ullint;
std::string YesNo[] = {"No","Yes"};
#define loop(i,N) for(int i=0; i<(N); i++)
template<typename T>
auto sort_all(T& v) { return std::sort(v.begin(),v.end()); }
template<typename T>
auto sum_all(const T v) { auto z = v[0]; z = 0;
    return std::accumulate(v.begin(),v.end(),z); }
template<typename T>
auto input(int N) {
    std::vector<T> v(N);
    loop(i,N) std::cin >> v[i];
    return std::move(v);
}

template<typename T>
class heapq
{
private:
    vector<T> array;

    void down_heapify(int i) {
        int m = i, left, right;
        int start_leaves = array.size()/2;
        while(i < start_leaves) {
            left = i*2 + 1;
            right = i*2 + 2;
            for(int k : {left, right}) {
                if(k < array.size() && array[k] < array[m]) {
                    m = k;
                }
            }
            if(m == i) {
                return;
            } else {
                std::swap(array[i], array[m]);
                i = m;
            }
        }
    };

    void up_heapify(int i) {
        while(i > 0) {
            int parent = (i-1)/2;
            if(array[i] < array[parent]) {
                std::swap(array[i], array[parent]);
                i = parent;
            } else {
                return;
            }
        }
    };

public:
    heapq(vector<T> array_=vector<T>(0)) {
        array = array_;
        heapify();
    };

    void heapify() {
        for(int i=array.size()/2-1; i>=0; i--) {
            down_heapify(i);
        }
    };

    void heappush(const T& x) {
        array.push_back(x);
        up_heapify(array.size()-1);
    };

    T heappop() {
        auto ret = std::move(array[0]);
        array[0] = array[array.size()-1];
        array.pop_back();
        down_heapify(0);
        return ret;
    }

    T heappoppush(const T& x) {
        auto ret = std::move(array[0]);
        array.front = x;
        down_heapify(0);
        return ret;        
    }

    T heappushpop(const T& x) {
        if(x <= array.front) {
            return x;
        } else {
            return heappoppush(x);
        }
    }

    const T& min() {
        return array.front;
    };
};

typedef llint Int;
Int Max = 10000000000;

int main(void)
{
    Int N, Q;
    cin >> N >> Q;

    auto event = vector<vector<Int>>(0);
    loop(i,N) {
        Int S, T, X;
        cin >> S >> T >> X;
        event.push_back(vector<Int>({S-X, 1, X}));
        event.push_back(vector<Int>({T-X, 0, X}));
    }
    loop(q,Q) {
        Int d;
        cin >> d;
        event.push_back(vector<Int>({d, 2, 0}));
    }
    sort_all(event);

    Int xmin = Max;
    auto xq = heapq<pair<Int,Int>>();
    loop(i, 2*N+Q) {
        Int t = event[i][0];
        Int e = event[i][1];
        Int x = event[i][2];

        switch (e) {
            case 2:
                if (xmin >= Max) {
                    cout << -1 << endl;
                } else {
                    cout << xmin << endl;
                }
                break;
            case 1:
                if (x < xmin) {
                    xq.heappush(make_pair(xmin,1));
                    xmin = x;
                } else {
                    xq.heappush(make_pair(x,1));
                }
                break;
            case 0:
                if (x == xmin) {
                    int n = 0;
                    while (n <= 0) {
                        auto xe = xq.heappop();
                        if (xe.second == 1) {
                            n++;
                        } else {
                            n--;
                        }
                        x = xe.first;
                    }
                    xmin = x;
                } else {
                    xq.heappush(make_pair(x,0));
                }
        } // switch
    } // loop(i, N+Q)

    return 0;
}

Measured memory_bytes: 51236