#include<complex>
#include<vector>
#include<iostream>
#include<stack>
#include<cmath>

#define sc second
#define fr first

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)

using namespace std;

typedef double elem;
typedef complex<elem> point, vec;
typedef pair<point, point> line, hline, seg, pp;

const double eps = 1.0e-6;
const double pi = acos(-1.0);
const double infty = 1e120;
point base(0,0);

// lZ
inline elem sq(elem a){ return a*a; }
inline elem cq(elem a){ return a*a*a; }

// pxÏ·
elem rad(elem deg){ return (deg/180)*pi; }
elem deg(elem rad){ return (rad*180)/pi; }

// ®¬_Ìô¢AÈÇ
bool eq(elem a, elem b){ return abs(a-b) < eps; }
bool lt(elem a, elem b){ return !eq(a,b) && a < b; }
bool leq(elem a, elem b){ return eq(a,b) || a < b; }
bool gt(elem a, elem b){ return !eq(a,b) && a > b; }
bool geq(elem a, elem b){ return eq(a,b) || a > b; }
bool ltz(elem a){ return lt( a, 0 ); }
bool gtz(elem a){ return gt( a, 0 ); }
bool eqv(vec a, vec b){ return eq( abs(b-a),0); }
bool is_zv(vec v){ return eq(abs(v),0); }
elem emax(elem a, elem b){ return gt(a,b)?a:b; }
elem emin(elem a, elem b){ return lt(a,b)?a:b; }

// _Iy[^
bool far(point a, point b){ return gtz( abs(b-a) ); }
bool near(point a, point b){ return leq( abs(b-a), 0 ); }
elem dot(vec a, vec b){ return (a.real() * b.real() + a.imag() * b.imag() ); }
elem cross(vec a, vec b){ return ( a.real() * b.imag() - a.imag() * b.real() ); }

// a©çbÜÅvñèÌpxAàpA]ñ]
elem varg(vec a, vec b){
  elem ret=arg(a)-arg(b);
  if(lt(ret,0))ret+=2*pi;
  if(gt(ret,2*pi))ret-=2*pi;
  if(eq(ret,2*pi))ret=0;
  return ret;
}
elem arg(vec a, vec b){ return acos( dot(a,b) / ( abs(a) * abs(b) ) ); }
point rot(point p, elem theta){ return p * polar((elem)1.0, theta); }
point rotdeg(point p, elem deg){ return p * polar((elem)1.0, rad(deg)); }
point proj(line l, point p){
  double t=dot(p-l.first,l.first-l.second)/abs(l.first-l.second);
  return l.first + t*(l.first-l.second);
}
point reflect(line l, point p){ return p+2.0*(proj(l,p)-p); }

// ñ_Ô£A¼üÆ_ÌÅZ£AüªÆ_ÌÅZ£
elem dist(point a, point b){ return abs(a-b); }
elem dist_l(line l, point x){ return abs(cross(l.sc-l.fr,x-l.fr)) / abs(l.sc-l.fr); }
elem dist_seg(seg s, point x)
{
  if( ltz( dot(s.sc-s.fr,x-s.fr) ) ) return abs(x-s.fr);
  if( ltz( dot(s.fr-s.sc,x-s.sc) ) ) return abs(x-s.sc);
  return dist_l(s,x);
}

// PÊxNgA@üxNgAPÊ@üxNg
vec uvec(vec a){ return a / abs(a); }
vec nmr(vec a){ return a * vec(0,-1); }
vec nml(vec a){ return a * vec(0,1); }
vec unmr(vec a){ return uvec( nmr(a) ); }
vec unml(vec a){ return uvec( nml(a) ); }


class Dog{
public:
  point p;
  elem v;
  int score;
  Dog():p(point(0,0)),v(0.0),score(0){}
  Dog(point p, elem v):p(p),v(v),score(0){}
  void move(point target, double t){
    vec V = target - p;
    V = t * v * uvec(V);
    p = p + V;
  }
};

class Frisbee{
public:
  point p;
  vec v;
  Frisbee():p(point(0,0)),v(vec(0,0)){}
  Frisbee(point p, vec v):p(p),v(v){}
};

bool reachable(const Dog &dog, const Frisbee &fris, double &time)
{
  if(near(dog.p,fris.p)){time=0;return true;}
  vec A=vec(dog.p-fris.p);
  double a = pow(abs(dog.v),2.0)-pow(abs(fris.v),2.0);
  double b = dot(A,fris.v);
  double c = -pow(abs(A),2.0);
  double D = pow(b,2.0)-a*c;
  if( eq(a, 0.0) ){time=infty;return false;}
  if( lt(D, 0.0) ){time=infty;return false;}
  double t = (-b+sqrt(D))/a;
  if( lt(t, 0.0) ){
    return false;
  }
  time = t;
  return true;
}

int main(){
  while(true){
    int N;
    int M;
    //cout <<"START" << endl;
    cin >> N >> M;
    //cout << N << ' ' << M << endl;
    if( N == 0 && M == 0 ) break;
    vector<Dog> dogs;
    vector<Frisbee> fris;

    for(int i = 0; i < N; ++i){
      elem x,y,v;
      cin >> x >> y >> v;
      dogs.push_back( Dog(point(x,y),v) );
    }

    for(int i = 0; i < M; ++i){
      elem x,y,vx,vy;
      cin >> x >> y >> vx >> vy;
      fris.push_back( Frisbee( point(x,y), vec(vx,vy) ) );
    }
    
    for(int i = 0; i < M; ++i){
      elem min_time = infty;
      int min_dog = -1;
      bool reach[16];
      elem times[16];
      
      for(int j = 0; j < N; ++j){
	elem time;
	reach[j] = reachable( dogs[j], fris[i], time );
	if( reach[j] ){
	  if( lt(time,min_time) ){
	    min_time = time;
	    min_dog = j;
	  }
	}
	times[j] = time;
      }
      
      dogs[min_dog].score++;
      for(int j = 0; j < N; ++j){
	if( reach[j] ){
	  point T = ( times[j] * fris[i].v ) + fris[i].p;
	  //cout << times[j] << ' ' << " DISTANCE : " << abs(T-dogs[j].p) << ' ' << dogs[j].p << ' ' << T << endl;
	  dogs[j].move( T, min_time );

	  //cout << dogs[j].p << endl;
	}
      }
      
    }
    
    for(int i = 0; i < N; ++i){
      if( i > 0 ) cout << ' ';
      cout << dogs[i].score; 
    }
    cout << endl;
    //cout << "END" << endl;
  }
  return 0;
}

Measured memory_bytes: 1052