#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define N 200010
struct node
{
    int s,t,x;
   bool  operator < (const node &b) const
    {
        return x>b.x;
    }
}a[N];
priority_queue<node>Q;
bool cmp(node a,node b)
{
    return a.s<b.s;
}
int d[N];
int main()
{
    int n,q;
    scanf("%d%d",&n,&q);
    for(int i=1;i<=n;i++)
    {
        scanf("%d%d%d",&a[i].s,&a[i].t,&a[i].x);
        a[i].s-=a[i].x;
        a[i].t-=a[i].x;
    }
    sort(a+1,a+1+n,cmp);
    for(int i=1;i<=q;i++)
        scanf("%d",&d[i]);
    int t=1;
    for(int i=1;i<=q;i++)
    {
        while(a[t].s<=d[i] && t<=n){Q.push(a[t]),t++;}

        bool flag=0;
        while(Q.size())
        {
            node now=Q.top();
            if(d[i]>=now.t){Q.pop();continue;}
            flag=1;
            printf("%d\n",now.x);
            break;
        }
        if(!flag)printf("-1\n");
    }
    return 0;
}
