#include <bits/stdc++.h>
using i64 = long long;

int main() {
    int n, q;
    std::cin >> n >> q;
    enum { time, type, val };
    std::vector<std::tuple<int, int, int>> ev;
    for (int i = 0; i < n; i++) {
        int s, t, x;
        std::cin >> s >> t >> x;
        ev.emplace_back(s - x, 1, x);
        ev.emplace_back(t - x, 0, x);
    }
    std::sort(ev.begin(), ev.end());
    auto it = ev.begin();
    std::set<int> s;
    for (int i = 0; i < q; i++) {
        int d;
        std::cin >> d;
        while (it != ev.end() && std::get<time>(*it) <= d) {
            int v = std::get<val>(*it);
            if (std::get<type>(*it)) s.insert(v);
            else s.erase(v);
            it++;
        }
        std::cout << (s.empty() ? -1 : *s.begin()) << std::endl;
    }

    return 0;
}
