#include <bits/stdc++.h>
using namespace std;
int n,m,b[200010],mk[200010];
struct edge {
int l,r,k;
}a[200010];
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",&a[i].l,&a[i].r,&a[i].k);
}
for (int i=1;i<=m;i++) {
cin >> b[i];
int res=0;
for (int j=1;j<=n;j++) {
if (a[j].l<=b[i]&&b[i]<=a[j].r) a[j].k--;
if (mk[j]==0) if (a[j].k<=0) mk[j]=1,res++;
}
printf("%d",res);
}
return 0;
}