#include<bits/stdc++.h>
using namespace std;

int read(){
    int x=0;bool f=0;char c=getchar();
    while(c<'0'||c>'9') f|=c=='-',c=getchar();
    while(c>='0'&&c<='9') x=x*10+(c^48),c=getchar();
    return f?-x:x;
}

#define MAXN 200000
int N,M;
struct Node{
    int l,r,p;
    bool operator < (Node other) const{
        return (p==other.p)?(l==other.l?r<other.r:l<other.l):(p<other.p);
    }
}A[MAXN+5];

bool In(Node i,int x){
    return x>=i.l&&x<i.r;
}

int main(){
    //freopen("road.in" ,"r", stdin);
    //freopen("road.out","w",stdout);
    N=read(),M=read();
    for(int i=1;i<=N;i++)
        A[i].l=read(),A[i].r=read(),A[i].p=read();
    set<Node> R;
    for(int i=1;i<=N;i++){
        A[i].l=max(A[i].l-A[i].p,0);
        A[i].r=max(A[i].r-A[i].p,0);
        R.insert(A[i]);
    }
    int i=1;
    set<Node> Cover;
    while(M--){
        int D=read();
        set<Node> tmp;
        for(Node i:R)
            if(In(i,D))
                Cover.insert(i),
                tmp.insert(i);  q
        for(Node i:tmp)
            R.erase(i);
        tmp.clear();
        for(Node i:Cover)
            if(!In(i,D))
                tmp.insert(i);
        for(Node i:tmp)
            Cover.erase(i);
        if(Cover.empty())
            puts("-1");
        else
            printf("%d\n",Cover.begin()->p);
    }
}
