#include<bits/stdc++.h>
using namespace std;
int n,m,x_1[200005],x_2[200005],s[200005],x[200005],sum;
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",&x_1[i],&x_2[i],&s[i]);
}
for (int i=1;i<=m;i++){
scanf("%d",&x[i]);
}
for (int i=1;i<=m;i++){
int sum=0;
for (int j=1;j<=n;j++){
if (x_1[j]<=x[i]&&x[i]<=x_2[j]){
s[j]--;
}
if (s[j]==0){
sum++;
s[j]=-1;
}
}
printf("%d\n",sum);
}
return 0;
}