#include using namespace std; using ll = long long; const int M = 1550; int imos[M][M]; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); int N, K; cin >> N >> K; const int off = 500; vector> P(N); for(auto&[x, y, hp] : P) { cin >> x >> y >> hp; x += off, y += off; } for(int i = 0; i < K; i++) { int x, y, w, h, d; cin >> x >> y >> w >> h >> d; x += off, y += off; // [x, x + w], [y, y + h] assert(0<=x&&x+w+1