#include <bits/stdc++.h>
using namespace std;
const int N=200010;
int l[N],r[N],val[N],flag[N],n,m;
int main() {
freopen("shooting.in","r",stdin);
freopen("shooting.out","w",stdout);
scanf("%d%d",&n,&m);
for (int i=1;i<=n;i++)
{
scanf("%d%d%d",&l[i],&r[i],&val[i]);
}
while (m--)
{
int q;
scanf("%d",&q);
int ret=0;
for (int i=1;i<=n;i++)
{
if (!flag[i] && l[i]<=q && q<=r[i])
{
val[i]--;
if (val[i]==0)
{
flag[i]=1;
ret++;
}
}
}
printf("%d\n",ret);
}
}