#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#ifdef _DEBUG_
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl
#else
#define dump(val)
#endif

using namespace std;

typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}

template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

// 負なら追い付ける
double Dist(double dx, double dy, double fx, double fy, double v) {
    return hypot(dx - fx, dy - fy) - v;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    const double inf = 1e+15;
    const double eps = 1e-6;
    int n, m;
    while (cin >> n >> m, n + m) {
        vector<double> Dx(n), Dy(n), V(n);
        REP(i, 0, n) {
            cin >> Dx[i] >> Dy[i] >> V[i];
        }
        vector<int> ans(n, 0);
        REP(_, 0, m) {
            double fx, fy, fvx, fvy;
            cin >> fx >> fy >> fvx >> fvy;
            double minT = inf;
            int minI = 0;
            vector<bool> get(n, false);
            vector<double> T(n, inf);
            vector<double> X(n, inf), Y(n, inf);
            REP(i, 0, n) {
                // 3分探索
                {
                    double l = 0, r = inf, t = 0;
                    REP (__, 0, 100) {
                        double m1 = (2 * l + r) / 3, m2 = (l + 2 * r) / 3;
                        double dist1 = Dist(Dx[i], Dy[i], fx + fvx * m1, fy + fvy * m1, V[i] * m1);
                        double dist2 = Dist(Dx[i], Dy[i], fx + fvx * m2, fy + fvy * m2, V[i] * m2);
                        if (dist1 > dist2) {
                            l = m1;
                            t = min(t, dist2);
                            T[i] = m2;
                        } else {
                            r = m2;
                            t = min(t, dist1);
                            T[i] = m1;
                        }
                        //cerr << T[i] << endl;
                    }
                    get[i] = (t < 0);
                }

                //2分探索
                if (get[i]) {
                    double l = 0, r = T[i];
                    REP (__, 0, 100) {
                        double mid = (l + r) / 2;
                        double dist = Dist(Dx[i], Dy[i], fx + fvx * mid, fy + fvy * mid, V[i] * mid);
                        //cerr << "?" << dist << endl;
                        if (dist < eps) {
                            get[i] = true;
                            T[i] = mid;
                            r = mid;
                            X[i] = fx + fvx * mid - Dx[i];
                            Y[i] = fy + fvy * mid - Dy[i];
                        } else {
                            l = mid;
                        }
                    }

                    //cerr << "!" << get[i] << " " << t << endl;
                    if (get[i] && T[i] + eps < minT) {
                        minT = T[i];
                        minI = i;
                    }
                }
            }

            //cerr << "!" << minT << " " << minI << endl;

            ans[minI]++;
            REP(i, 0, n) {
                if (get[i]) {
                    Dx[i] += minT / T[i] * X[i];
                    Dy[i] += minT / T[i] * Y[i];
                }
                //cerr << "ps" << Dx[i] << " " << Dy[i] << endl;
            }
        }
        REP(i, 0, n) {
            cout << ans[i] << " \n"[i + 1 == n];
        }
        cout << flush;
    }
    return 0;
}



Measured memory_bytes: 3284