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