#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <iomanip>
#include <cassert>
#include <random>


#line 1 "lib/lazy_segment_tree.hpp"



#include <vector>
#include <algorithm>
#include <functional>

template<typename Monoid, typename Operator>
class LazySegmentTree {
public:
    // mono_product(a, b)
    using MonoidProduct = std::function<Monoid(Monoid, Monoid)>;

    // op_product(p, q)(a) = p(q(a)) (not q(p(a)))
    using OperatorProduct = std::function<Operator(Operator, Operator)>;

    // act(p, n, a) = (p, n)(a)
    // n: Length of the range.
    using Actor = std::function<Monoid(Operator, int, Monoid)>;

    Monoid init_mono = 1e9 + 2;
    Monoid mono_product(Monoid a, Monoid b) {
        return std::min(a, b);
    }

    Operator init_op = 1e9 + 2;
    Operator op_product(Operator p, Operator q) {
        return std::min(p, q);
    }

    Monoid act(Operator p, int n, Monoid a) {
        return std::min(p, a);
    }

    LazySegmentTree(int n) {

        num = 1;
        while (num < n) num *= 2;
        dat_mono = std::vector<Monoid>(2 * num, init_mono);
        dat_op = std::vector<Operator>(2 * num, init_op);
    }

    LazySegmentTree(const std::vector<Monoid> &m) {

        int n = m.size();
        for (int i = 0; i < n; i++) {
            dat_mono[num - 1 + i] = m[i];
        }
        for (int i = num - 2; i >= 0; i--) {
            dat_mono[i]
                = mono_product(dat_mono[2 * i + 1], dat_mono[2 * i + 2]);
        }
    }

    // Apply the operator q to the range [a, b).
    // k: The index of the node.
    // Call like apply(q, a, b)
    void apply(Operator q, int a, int b,
        int k = 0, int left = 0, int right = -1) {

        if (right < 0) right = num;
        if (right <= a || b <= left) return;
        if (a <= left && right <= b) {
            dat_mono[k] = act(q, right - left, dat_mono[k]);
            dat_op[k] = op_product(q, dat_op[k]);
            return;
        }
        apply(dat_op[k], left, left + (right - left) / 2,
            2 * k + 1, left, left + (right - left) / 2); // Left side
        apply(dat_op[k], left + (right - left) / 2, right,
            2 * k + 2, left + (right - left) / 2, right); // Right side
        dat_op[k] = init_op;
        apply(q, a, b,
            2 * k + 1, left, left + (right - left) / 2); // Left side
        apply(q, a, b,
            2 * k + 2, left + (right - left) / 2, right); // Right side
        dat_mono[k]
            = mono_product(dat_mono[2 * k + 1], dat_mono[2 * k + 2]);
    }

    // Get the value of the range [a, b).
    // k: The index of the node.
    // [left, right): The range corresponds to the k-th node.
    // Call like getval(a, b).
    Monoid getval(int a, int b, int k = 0, int left = 0, int right = -1) {
        if (right < 0) right = num;
        if (right <= a || b <= left) return init_mono;
        if (a <= left && right <= b) return dat_mono[k];
        Monoid vleft = getval(a, b,
            2 * k + 1, left, left + (right - left) / 2); // Left side
        Monoid vright = getval(a, b,
            2 * k + 2, left + (right - left) / 2, right); // Right side
        return act(dat_op[k],
            std::max(0, std::min(b, right) - std::max(a, left)),
            mono_product(vleft, vright));
    }

private:
    int num;
    std::vector<Monoid> dat_mono;
    std::vector<Operator> dat_op;
};


int main() {
    int n, q; std::cin >> n >> q;
    std::vector<int> s(n), t(n), x(n), d(q);
    for (int i = 0; i < n; i++) std::cin >> s[i] >> t[i] >> x[i];
    for (int i = 0; i < q; i++) std::cin >> d[i];
    std::map<int, int> mp;
    for (int i = 0; i < n; i++) mp[s[i] - x[i]], mp[t[i] - x[i]];
    for (int i = 0; i < q; i++) mp[d[i]];
    int cnt = 0;
    for (auto &p : mp) p.second = cnt++;
    LazySegmentTree<int, int> seg(cnt);
    for (int i = 0; i < n; i++) {
        seg.apply(x[i], mp[s[i] - x[i]], mp[t[i] - x[i]]);
    }
    for (int i = 0; i < q; i++) {
        int ans = seg.getval(mp[d[i]], mp[d[i]] + 1);
        std::cout << (ans != 1e9 + 2 ? ans : -1) << std::endl;
    }
    return 0;
}


Measured memory_bytes: 48896