#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define chmax(a,b) (a<b?(a=b,1):0)
#define chmin(a,b) (a>b?(a=b,1):0)
#define valid(y,x,h,w) (0<=y&&y<h&&0<=x&&x<w)
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

typedef complex<double> P;

namespace std {
  bool operator < (const P& a, const P& b) {
    // if (abs(a-b)<EPS) return 0;
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}
double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}
struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
  L() {}
};
typedef vector<P> G;
#define curr(P, i) P[i]
#define next(P, i) P[(i+1)%P.size()]
struct C {
  P p; double r;
  C(const P &p, double r) : p(p), r(r) { }
};

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

bool intersectLL(const L &l, const L &m) {
  return abs(cross(l[1]-l[0], m[1]-m[0])) > EPS || // non-parallel
         abs(cross(l[1]-l[0], m[0]-l[0])) < EPS;   // same line
}
bool intersectLS(const L &l, const L &s) {
  return cross(l[1]-l[0], s[0]-l[0])*       // s[0] is left of l
         cross(l[1]-l[0], s[1]-l[0]) < EPS; // s[1] is right of l
}
bool intersectLP(const L &l, const P &p) {
  return abs(cross(l[1]-p, l[0]-p)) < EPS;
}
bool intersectSS(const L &s, const L &t) {
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
         ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}
bool intersectSS2(const L &s, const L &t) { // 接しているやつは交差と考えない
  REP(i, 2) {
    if (ccw(s[0], s[1], t[i]) == 0) {
      int c = ccw(s[0],s[1],t[!i]);
      if (s[0] == t[i]) {
        if (c!=-2&&c) return 0;
      } else if (s[1] == t[i]) {
        if (c!=2&&c) return 0;
      } else if (abs(c)==1) return 0;
    }
  }
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
         ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}
bool intersectSP(const L &s, const P &p) {
  return norm(s[0]-p)+norm(s[1]-p)-norm(s[1]-s[0]) < EPS; // triangle inequality
}

P projection(const L &l, const P &p) {
  double t = dot(p-l[0], l[0]-l[1]) / norm(l[0]-l[1]);
  return l[0] + t*(l[0]-l[1]);
}
P reflection(const L &l, const P &p) {
  return p + P(2,0) * (projection(l, p) - p);
}
double distanceLP(const L &l, const P &p) {
  return abs(p - projection(l, p));
}
double distanceLL(const L &l, const L &m) {
  return intersectLL(l, m) ? 0 : distanceLP(l, m[0]);
}
double istanceLS(const L &l, const L &s) {
  if (intersectLS(l, s)) return 0;
  return min(distanceLP(l, s[0]), distanceLP(l, s[1]));
}
double distanceSP(const L &s, const P &p) {
  const P r = projection(s, p);
  if (intersectSP(s, r)) return abs(r - p);
  return sqrt(min(norm(s[0] - p), norm(s[1] - p)));
}


P d[10];
double v[10];
P fp[1000];
P fv[1000];

P f(int dog, int fri, double t) {
  P res(fp[fri] + fv[fri]*t - d[dog]);
  res /= abs(res);
  return res;
}

const double inf = 1e100;
double calc(int dog, int fri, P &dir) {
  double A = norm(fv[fri]) - v[dog]*v[dog];
  double B = 2*dot(fp[fri]-d[dog],fv[fri]);
  double C = norm(fp[fri]-d[dog]);
  if (C<EPS) {
    dir = P(1,0);
    return 0;
  }
  dir.real() = inf;
  if (A == 0) {
    if (B == 0) return inf;
    double t = -C/B;
    if (t < 0) return INF;
    dir = f(dog,fri,t);
    return t;
  } else {
    double D = B*B-4*A*C;
    if (D<=0) return inf;
    double t1 = (-B+sqrt(D))/A/2;
    double t2 = (-B-sqrt(D))/A/2;
    double t = inf;
    if (t1 >= 0) t = min(t,t1);
    if (t2 >= 0) t = min(t,t2);
    if (t > 1e50) return inf;
    dir = f(dog,fri,t);
    return t;
  }
}

P dir[10];

int main() {
  int n,m;
  while(cin>>n>>m,n||m) {
    REP(i,n) {
      cin >> d[i].real() >> d[i].imag() >> v[i];
    }
    REP(i,m) {
      cin >> fp[i].real() >> fp[i].imag() >> fv[i].real() >> fv[i].imag();
    }

    int count[10] = {};
    
    REP(i,m) {
      double t = 1e20;
      int id = -1;      

      REP(j,n) {
        double tmp = calc(j,i,dir[j]);
        if (chmin(t, tmp)) id = j;
      }
      count[id]++;
      REP(j,n) {
        if (dir[j].real() < 1e50) {
          d[j] += dir[j]*v[j]*t;
        }
        // cout << d[j] << " ";
      }
      // cout << endl;
    }
    REP(i,n) printf("%d%c",count[i],(i!=n-1?' ':'\n'));
  }
}

Measured memory_bytes: 1272