#include <bits/stdc++.h>
using namespace std;
int n, m, x1[200005], x2[200005], a[200005], x;
bool o[200005] = {false};
int main () {
freopen ("shooting.in", "r", stdin);
freopen ("shooting.out", "w", stdout);
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> x1[i] >> x2[i] >> a[i];
}
for (int i = 1; i <= m; i++) {
cin >> x;
int ans = 0;
for (int j = 1; j <= n; j++) {
if (x >= x1[j] && x <= x2[j]) {
a[j] --;
if (a[j] <= 0 && o[j] == false) ans ++, o[j] = true;
}
}
cout << ans << endl;
}
return 0;
}