#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

const double EPS = 1.0e-10;

double pow2(double a){
    return a * a;
}

int main()
{
    for(;;){
        int n, m;
        cin >> n >> m;
        if(n == 0)
            return 0;

        vector<double> x(n), y(n), v(n);
        for(int i=0; i<n; ++i)
            cin >> x[i] >> y[i] >> v[i];

        vector<int> num(n, 0);
        while(--m >= 0){
            double fpx, fpy, fvx, fvy;
            cin >> fpx >> fpy >> fvx >> fvy;

            vector<double> vy(n, 0.0), vx(n, 0.0);
            double minT = DBL_MAX;
            int getDog;
            for(int i=0; i<n; ++i){
                double a = pow2(fvx) + pow2(fvy) - pow2(v[i]);
                double b = 2 * (fvx * (fpx - x[i]) + fvy * (fpy - y[i]));
                double c = pow2(fpx - x[i]) + pow2(fpy - y[i]);
                double d = pow2(b) - 4 * a * c;
                if(d >= 0.0){
                    double t;
                    if(fabs(a) < EPS){
                        t = - c / b;
                        if(t < 0.0)
                            continue;
                    }else{
                        double tmp = (-b - sqrt(d)) / (2*a);
                        if(tmp >= 0.0)
                            t = tmp;
                        else{
                            tmp = (-b + sqrt(d)) / (2*a);
                            if(tmp >= 0.0)
                                t = tmp;
                            else
                                continue;
                        }
                    }
                    vx[i] = (fpx - x[i] + fvx * t) / t;
                    vy[i] = (fpy - y[i] + fvy * t) / t;
                    if(t < minT){
                        minT = t;
                        getDog = i;
                    }
                }
            }

            if(minT != DBL_MAX){
                ++ num[getDog];
                for(int i=0; i<n; ++i){
                    x[i] += vx[i] * minT;
                    y[i] += vy[i] * minT;
                }
            }
        }

        cout << num[0];
        for(int i=1; i<n; ++i)
            cout << ' ' << num[i];
        cout << endl;
    }
}