#include <bits/stdc++.h>

#ifdef DEBUG
#define PRINT(x)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#x<<" = "<<(x)<<endl;
#define PRINTA(a,first,last)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<(first)<<", "<<(last)<<")"<<endl;\
    for (int i=(first);i<(last);++i){cout<<#a<<"["<<i<<"] = "<<(a)[i]<<endl;}
#define PRINTP(p)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#p<<" = ("<<(p.first)<<", "<<(p.second)<<")"<<endl;
#define PRINTI(a,i)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<#i<<"] = "<<#a<<"["<<(i)<<"] = "<<(a)[i]<<endl;
#else
#define PRINT(x)
#define PRINTA(a,first,last)
#define PRINTP(p)
#define PRINTI(a,i)
#endif

#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

template <class T, class U> void amax(T& x, U y) {if (x < y) x = y;}
template <class T, class U> void amin(T& x, U y) {if (x > y) x = y;}

const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

template<class T>
struct node {
    T key;
    node *left_child;
    node *right_child;
    int height;
    int multiplicity;

    node(T key) {
        this->key = key;
        this->left_child = nullptr;
        this->right_child = nullptr;
        this->height = 1;
        this->multiplicity = 1;
    }
};

template<class T>
int height(node<T> *x) {
    if (x == nullptr) {
        return 0;
    } else {
        return x->height;
    }
}

template<class T>
inline void update_height(node<T> *x) {
    x->height = 1 + max(height(x->left_child), height(x->right_child));
}

template<class T>
inline int balance_factor(node<T> *x) {
    return height(x->left_child) - height(x->right_child);
}

template<class T>
node<T> *min_key_node(node<T> *x) {
    while (x->left_child != nullptr) {
        x = x->left_child;
    }
    return x;
}

template<class T>
node<T> *max_key_node(node<T> *x) {
    while (x->right_child != nullptr) {
        x = x->right_child;
    }
    return x;
}

template<class T>
inline void rotr(node<T> *&x) {
    node<T> *y = x->left_child;
    x->left_child = y->right_child;
    y->right_child = x;
    update_height(x);
    update_height(y);
    x = y;
}

template<class T>
inline void rotl(node<T> *&x) {
    node<T> *y = x->right_child;
    x->right_child = y->left_child;
    y->left_child = x;
    update_height(x);
    update_height(y);
    x = y;
}

template<class T>
inline void rotlr(node<T> *&x) {
    rotl(x->left_child);
    rotr(x);
}

template<class T>
inline void rotrl(node<T> *&x) {
    rotr(x->right_child);
    rotl(x);
}

template<class T>
inline void rebalance(node<T> *&x) {
    if (height(x->left_child) > height(x->right_child)) {
        node<T> *y = x->left_child;
        if (height(y->left_child) >= height(y->right_child)) {
            // left left case
            rotr(x);
        } else {
            // left right case
            rotlr(x);
        }
    } else if (height(x->left_child) < height(x->right_child)) {
        node<T> *y = x->right_child;
        if (height(y->left_child) <= height(y->right_child)) {
            // right right case
            rotl(x);
        } else {
            // right left case
            rotrl(x);
        }
    } else {
        assert(0);
    }
}

template<class T>
node<T> *find(node<T> *x, T key) {
    if (x == nullptr) {
        return nullptr;
    } else {
        if (key < x->key) {
            return find(x->left_child, key);
        } else if (x->key < key) {
            return find(x->right_child, key);
        } else {
            return x;
        }
    }
}

template<class T>
void insert(node<T> *&x, T key) {
    if (x == nullptr) {
        x = new node<T>(key);
    } else {
        if (key < x->key) {
            insert(x->left_child, key);
        } else if (x->key < key) {
            insert(x->right_child, key);
        } else {
            ++x->multiplicity;
            return;
        }
        update_height(x);
        if (abs(balance_factor(x)) >= 2) {
            rebalance(x);
        }
    }
}

template<class T>
void remove(node<T> *&x, T key) {
    if (x == nullptr) {
        return;
    }
    if (key < x->key) {
        remove(x->left_child, key);
    } else if (x->key < key) {
        remove(x->right_child, key);
    } else {
        if (x->multiplicity >= 2) {
            --x->multiplicity;
            return;
        }
        if (x->left_child == nullptr || x->right_child == nullptr) {
            //cout << "zero or one child case" << endl;
            node<T> *y = x->left_child ? x->left_child : x->right_child;
            delete x;
            x = y;
            return;
        } else {
            //cout << "two child case" << endl;
            /*
            node<T> *y = min_key_node(x->right_child);
            x->key = y->key;
            remove(x->right_child, y->key);
            */
            x->key = remove_min(x->right_child);
        }
    }
    update_height(x);
    if (abs(balance_factor(x)) >= 2) {
        rebalance(x);
    }
}

// remove the node with min key.
// return the min key.
template<class T>
T remove_min(node<T> *&x) {
    if (x->left_child == nullptr) {
        T result = x->key;
        if (x->multiplicity >= 2) {
            --x->multiplicity;
        } else {
            node<T> *y = x->right_child;
            delete x;
            x = y;
        }
        return result;
    } else {
        T result = remove_min(x->left_child);
        update_height(x);
        if (abs(balance_factor(x)) >= 2) {
            rebalance(x);
        }
        return result;
    }
}

int main() {
    int N, Q;
    cin >> N >> Q;
    vector<int> S(N), T(N), X(N), D(Q);
    REP(i, N) cin >> S[i] >> T[i] >> X[i];
    REP(i, Q) cin >> D[i];

    using triple = tuple<int, int, int>;
    vector<triple> v;
    REP(i, N) {
        v.pb(triple(S[i] - X[i], 0, i));
        v.pb(triple(T[i] - X[i], 1, i));
    }
    REP(i, Q) {
        v.pb(triple(D[i], 2, i));
    }
    sort(all(v));
    node<int> *roadworks = nullptr;
    vector<int> result(Q, -1);
    for (triple t: v) {
        if (get<1>(t) == 0) {
            insert(roadworks, X[get<2>(t)]);
        } else if (get<1>(t) == 1) {
            remove(roadworks, X[get<2>(t)]);
        } else if (get<1>(t) == 2) {
            if (roadworks != nullptr) {
                result[get<2>(t)] = min_key_node(roadworks)->key;
            }
        }
    }
    REP(i, Q) cout << result[i] << endl;
    return 0;
}

Measured memory_bytes: 22888