Program Captain;
Var a,b,c:array[0..200001]of longint;
n,m,i,j,x,sum:longint;
Begin
Assign(input,'shooting.in');Assign(output,'shooting.out');
Reset(input);Rewrite(output);
Readln(n,m);
For i:=1 to n do read(a[i],b[i],c[i]);
For j:=1 to m do begin
Readln(x);sum:=0;
For i:=1 to n do If (((x<b[i])and (x>a[i]))or (x=b[i])or (x=a[i]))and (c[i]>0)then begin
dec(c[i]);
If c[i]<1 then inc(sum);
End;
Writeln(sum);
End;
Close(input);Close(output);
End.