#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define sz(a) a.size()
#define all(a) a.begin(),a.end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define SS stringstream
#define DBG1(a) rep(_X,sz(a)){printf("%d ",a[_X]);}puts("");
#define DBG2(a) rep(_X,sz(a)){rep(_Y,sz(a[_X]))printf("%d ",a[_X][_Y]);puts("");}
#define bitcount(b) __builtin_popcount(b)
#define REP(i, s, e) for ( int i = s; i <= e; i++ )  
 
const double INF = 1e12;
typedef complex<double> P,point;
typedef vector<P> G,polygon;
namespace std {bool operator < (const P& a, const P& b) {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(){} };
struct C {P p; double r;C(const P &p, double r) : p(p), r(r) { } C(){} };
int ccw(P a, P b, P c) {
	b -= a; c -= a;
	if (cross(b, c) > 0)   return +1;
	if (cross(b, c) < 0)   return -1;
	if (dot(b, c) < 0) return +2;
	if (norm(b) < norm(c)) return -2;
	return 0;
}
 
// Check Funcs //
bool intersectLL(const L &l, const L &m) {return abs(cross(l[1]-l[0], m[1]-m[0])) > EPS || abs(cross(l[1]-l[0], m[0]-l[0])) < EPS;}
bool intersectLS(const L &l, const L &s) {return cross(l[1]-l[0], s[0]-l[0])*cross(l[1]-l[0], s[1]-l[0]) < EPS;}
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 intersectSP(const L &s, const P &p) {return abs(s[0]-p)+abs(s[1]-p)-abs(s[1]-s[0]) < EPS;}
 
// Where is Point in Polygon? //
#define curr(P, i) P[i]
#define next(P, i) P[(i+1)%P.size()]
enum { OUT, ON, IN };
int contains(const polygon& P, const point& p) {
	bool in = false;
	for (int i = 0; i < P.size(); ++i) {
		point a = curr(P,i) - p, b = next(P,i) - p;
		if (imag(a) > imag(b)) swap(a, b);
		if (imag(a) <= 0 && 0 < imag(b))
			if (cross(a, b) < 0) in = !in;
		if (cross(a, b) == 0 && dot(a, b) <= 0) return ON;
	}
	return in ? IN : OUT;
}
// Area of Polygon //
double area2(const polygon& P) {
	double A = 0;
	for (int i = 0; i < P.size(); ++i)A += cross(curr(P, i), next(P, i));
	return A;
}
// Totsuhou! Andrew's Monotone Chain //
 
vector<point> convex_hull(vector<point> ps) {
  int n = ps.size(), k = 0;
  sort(ps.begin(), ps.end());
  vector<point> ch(2*n);
  for (int i = 0; i < n; ch[k++] = ps[i++]) // lower-hull
    while (k >= 2 && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
  for (int i = n-2, t = k+1; i >= 0; ch[k++] = ps[i--]) // upper-hull
    while (k >= t && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
  ch.resize(k-1);
  return ch;
}
 
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 + 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 distanceLS(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 min(abs(s[0] - p), abs(s[1] - p));
}
double distanceSS(const L &s, const L &t) {
	if (intersectSS(s, t)) return 0;
	return min(min(distanceSP(s, t[0]), distanceSP(s, t[1])),min(distanceSP(t, s[0]), distanceSP(t, s[1])));
}
 
P crosspoint(const L &l, const L &m) {
	double A = cross(l[1] - l[0], m[1] - m[0]);
	double B = cross(l[1] - l[0], l[1] - m[0]);
	if (abs(A) < EPS && abs(B) < EPS) return m[0];
	return m[0] + B / A * (m[1] - m[0]);
}


vector<L> e;
vector<L> l;
map<P,int> ee;
int flag = 0;

int n;
int done[1000];
int dfs(int x){
	done[x] = true;
	e.push_back(l[x]);
	ee[l[x][0]]++;
	ee[l[x][1]]++;
	
	for(int i = 0 ; i < n ; i++){
		if( distanceSS(l[x],l[i]) < EPS ){
			if( abs(l[x][0]-crosspoint(l[x],l[i])) > EPS && abs(l[x][1]-crosspoint(l[x],l[i])) > EPS ){
				flag++;
			}
		}
	}
	
	for(int i = 0 ; i < n ; i++){
		if( !done[i] && distanceSS(l[x],l[i]) < EPS ){
			dfs(i);
		}
	}
}

/*
	0: vertex : 4 , edge : 4 *
	1: vertex : 2 , edge : 1 *
	2: vertex : 6 , edge : 5 
	3: vertex : 5 , edge : 4 *
	4: vertex : 5 , edge : 3 *
	5: vertex : 6 , edge : 5 
	6: vertex : 6 , edge : 5 * NON-VERTEX EXISTS
	7: vertex : 4 , edge : 3 *
	8: vertex : 6 , edge : 5 *
	9: vertex : 4 , edge : 5 * NON-VERTEX EXISTS
*/

int check(int V,int E,int flag){
	if( V == 4 && E == 4 && flag == 0) return 0;
	if( V == 2 && E == 1 && flag == 0) return 1;
	if( V == 6 && E == 4 && flag == 1) return 3;
	if( V == 5 && E == 3 && flag == 1) return 4;
	
	if( V == 6 && E == 5 && flag == 1) return 6;
	if( V == 4 && E == 3 && flag == 0) return 7;
	if( V == 6 && E == 5 && flag == 2) return 8;
	if( V == 5 && E == 4 && flag == 1) return 9;
	
	return -1;
}
int main(){
	while(cin >> n && n){
		l.resize(n);
		for(int i = 0 ; i < n ; i++){	
			double a,b,c,d;
			cin >> a >> b >> c >> d;
			l[i] = L(P(a,b),P(c,d));
		}
		int ans[10]={};
		for(int i = 0 ; i < 1000 ; i++ ) done[i] = false;
		for(int i = 0 ; i < n ; i++){
			if( !done[i] ){
				e.clear();
				ee.clear();
				flag = 0;
				dfs(i);
				int V = ee.size();
				int E = e.size();
				//for(int j = 0 ; j < e.size() ; j++) 
				//	cout << e[j][0] << " " << e[j][1] << endl;
				//cout << endl;
				int r = check(V,E,flag);
				//cout << V << " " << E << " " << flag << "<" << r << endl;
				if( r == -1 ){
					P fst;
					for( map<P,int>::iterator it = ee.begin(); it != ee.end() ; ++it){
						if( it->second == 1 ){
							fst = it->first;
							break;
						}
					}
					P scd ;
					for(int i = 0 ; i < e.size() ; i++){
						if( e[i][0] == fst ){
							scd = e[i][1];
						}else if( e[i][1] == fst ){
							scd = e[i][0];
						}
					}
					P thd;
					for(int i = 0 ; i < e.size() ; i++){
						if( e[i][0] == scd && e[i][1] != fst){
							thd = e[i][1];
						}else if( e[i][1] == scd && e[i][0] != fst ){
							thd = e[i][0];
						}
					}
					//cout << fst << " " << scd << " " << thd << " " << ccw(fst,scd,thd) << endl;
					if( ccw(fst,scd,thd) < 0 ){
						ans[2]++;
					}else{
						ans[5]++;
					}
				}else{
					ans[r]++;
				}
			}
		}
		for(int i = 0 ; i < 10 ; i++) cout << ans[i] << (i==9?"\n":" ");
	}
}

Measured memory_bytes: 1352