#include<iostream>
#include<utility>
#include<algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
typedef pair<int,int> pii;

int main(){
	int n,a,b,ap,bp;
	cin>>n;
	int t[n];
	rep(i,n)t[i]=0;
	rep(i,n*(n-1)/2){
		cin>>a>>b>>ap>>bp;
		if(ap>bp)t[a-1]+=3;
		else if(ap<bp)t[b-1]+=3;
		else{
			t[a-1]++;t[b-1]++;
		}
	}
	pair<int,int> r[n],j[n];
	rep(i,n)r[i]=pair<int,int>(t[i],i+1);
	sort(r,r+n);
	for(int i=n-1,s=1,t=1;i>=0;i--){
		j[i]=pii(r[i].second,s);
		if(i==0)s++;
		t++;
		if(r[i].first!=r[i-1].first)s=t;
	}
	sort(j,j+n);
	rep(i,n)cout<<j[i].second<<endl;
	return 0;
}