#include<bits/stdc++.h>
using namespace std;
int n,m1;
int x1[100005],x2[100005],s[100005],x;
int main()
{
freopen("shooting.in","r",stdin);
freopen("shooting.out","w",stdout);
cin>>n>>m1;
for (int i=1;i<=n;i++)
cin>>x1[i]>>x2[i]>>s[i];
for (int i=1;i<=m1;i++)
{
cin>>x;
int ans=0;
for (int j=1;j<=n;j++)
if (x1[j]<=x&&x2[j]>=x&&s[j]>0)
{
s[j]=s[j]-1;
if (s[j]<1)
ans++;
}
cout<<ans;
}
return 0;
}