#if 1

#include <bits/stdc++.h>
using namespace std;
int n,q;
vector <pair <int,pair <int,int> > > a;
multiset <int> s;

int main()
{
    scanf("%d %d", &n, &q);
    int t,ss,x;
    for(int i = 1;i <= n;i++)
    {
        scanf("%d %d %d", &ss, &t, &x);
        a.push_back({ss-x,{1,x}});
        a.push_back({t-x,{-1,x}});
    }
    int i = 0;
    sort(a.begin(),a.end());
    while(q--)
    {
        int d;
        scanf("%d",&d);
        while(a[i].first <= d&&i < a.size())
        {
            if(a[i].second.first == 1)
            {
                s.insert(a[i].second.second);
            }
            else
            {
                s.erase(a[i].second.second);
            }
            i++;
        }
        if(s.size() > 0) printf("%d\n",*s.begin());
        else printf("-1\n");
    }
}

#endif // 1++
