Go: package main

import (
	"fmt"
	"bufio"
	"os"
	"strconv"
	"strings"
	"sort"
)

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextLineInt() []int {
	arr := strings.Split(nextLine(), " ")
	var ret []int
	for _, v := range arr {
		x, _ := strconv.Atoi(v)
		ret = append(ret, x)
	}
	return ret
}

type Pair struct {
	First int
	Second int
}

type Pairs []Pair

func (s Pairs) Len() int {
	return len(s)
}

func (s Pairs) Swap(i, j int) {
	s[i], s[j] = s[j], s[i]
}

func (s Pairs) Less(i, j int) bool {
	return s[i].First > s[j].First
}

func main() {
	var n int
	arr := nextLineInt()
	n = arr[0]
	result := []Pair{}
	for i := 0; i < n; i++ {
		result = append(result, Pair{0, i})
	}
	for i := 0; i < n * (n - 1) / 2; i++ {
		arr := nextLineInt()
		A := arr[0]
		B := arr[1]
		C := arr[2]
		D := arr[3]
		if C > D {
			result[A-1].First += 3
		} else if C < D {
			result[B-1].First += 3
		} else {
			result[A-1].First++
			result[B-1].First++
		}
	}
	sort.Sort(Pairs(result))
	var ans [111]int
	point := 1000000000
	top := 0
	for i, r := range result {
		// 前の人よりポイントが低い
		if point > r.First {
			top = i + 1
			point = r.First
		}
		ans[r.Second] = top
	}
	for i := 0; i < n; i++ {
		fmt.Println(ans[i])
	}
}

C++: #include <bits/stdc++.h>

#define rep_(v, f, l) for (int v = (f), v##_ = (l); v < v##_; ++v)
#define rep(v, n) rep_(v, 0, n)
#define lep(v, n) rep_(v, 1, n + 1)
#define rrep_(v, f, l) for (int v = (l), v##_ = (f); v >= v##_; --v)
#define rrep(v, n) rrep_(v, 0, n - 1)
#define rlep(v, n) rrep_(v, 1, n)
#define show_a(a, size) rep(a##_it, size) std::cout << a[a##_it] << " \n"[a##_it == a##_it_ - 1];
#define show_v(v) show_a(v, v.size())
#define eachv(v, i) rep(i, v.size())
#define reachv(v, i) rrep(i, v.size())
#define debug(x) std::cerr << #x << " = " << x << "\n";

using namespace std;

typedef long long int lint;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }

int main()
{
    int n = in();
    vector<int> score(n + 1, 0);
    rep(i, n * (n - 1) / 2){
        int a, b;
        int a_p, b_p;
        a = in();
        b = in();
        a_p = in();
        b_p = in();
        if (a_p == b_p){
            score[a] += 1;
            score[b] += 1;
        }
        else if (a_p > b_p){
            score[a] += 3;
        }
        else {
            score[b] += 3;
        }
    }
    lep(i, n){
        int rank = 1;
        lep(j, n){
            if (score[i] < score[j]) rank++;
        }
        printf("%d\n", rank);
    }

    return (0);
}

C++: #include <iostream>
#include <algorithm>
using namespace std ;

int Point( int x , int y ){
	if( x-y >  0 ) return 3;
	if( x-y == 0 ) return 1;
	if( x-y <  0 ) return 0;
}

int main(){
	
	int N;
	int team[110][2] = {};
	int a,b,c,d  ;
	
	cin >> N;
	for( int i=0 ; i<N ; i++ ){ team[i][1] = i+1 ; }
	for( int i=0 ; i<N*(N-1)/2 ; i++ ){
		cin >> a >> b >> c >> d ;
		
		team[a-1][0] += Point(c,d) ;
		team[b-1][0] += Point(d,c) ;
	}
	
	for( int i=0 ; i<N ; i++ ){
		for( int j=i+1 ; j<N ; j++ ){
			if( team[i][0] < team[j][0] ){
				swap( team[i]  ,team[j] ) ;
			}
			else if( team[i][0] == team[j][0] ){
				if( team[i][1] > team[j][1] ){
					swap( team[i] , team[j] ) ;
				}
			}
		}
	}
	
	for( int i=1 ; i<=N ; i++ ){
		int f = 0 ,cnt = 0 ,pnt=-1 ;
		for( int j=0 ; j<N ; j++ ){
			if( pnt != team[j][0] ){
				pnt = team[j][0] ;
				cnt += f+1 ; f=0 ;
			}else f++ ;
			
			if( team[j][1] == i ){
				cout << cnt << endl ;
				break ;
			}
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){	
	int score[200],val,ctn[200];
	memset(score, 0, sizeof(score));
	memset(ctn, 0, sizeof(ctn));
	cin >> val;
	int a, b, c, d;
	for (int i = 0; i < val * (val-1)/2; i++){
		cin >> a >> b >> c >> d;
		if (c < d)
			score[b-1] += 3;
		else if (c > d)
			score[a-1] += 3;
		else if (c == d){
			score[a-1]++;
			score[b-1]++;
		}
	}
	for (int a = 0; a < val; b++){
		for (int b = 0; b < val; b++){
			if (score[a] < score[b])
				ctn[a]++;
		}
	cout << ctn[a] << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=a;i<b;++i)
#define for_rev(i,a,b) for(int i=a;i>=b;--i)
#define allof(a) a.begin(),a.end()
#define minit(a,b) memset(a,b,sizeof(a))
#define size_of(a) (int)a.size()

typedef long long lint;
typedef double Double;
typedef pair< int, int > pii;

const int iINF = 1L << 30;
const lint lINF = 1LL << 60;
const Double EPS = 1e-9;

int N;
int win[110];
int rank[110];

void solve() {
	int rep = N * (N - 1) / 2;

	for_(i,0,rep) {
		int A, B, C, D; cin >> A >> B >> C >> D;
		--A; --B;
		if (C < D) win[B] += 3;
		else if (C > D) win[A] += 3;
		else {
			++win[A];
			++win[B];
		}
	}
	
	vector< pii > vp;
	for_(i,0,N) {
		vp.push_back(pii(win[i], i));
	}
	
	sort(allof(vp), greater<pii>());
	
	int nw = iINF;
	int r = 0;
	int add = 1;
	
	for_(i,0,N) {
		pii p = vp[i];
		
		if (nw > p.first) {
			r += add;
			add = 1;
			nw = p.first;
		} else {
			++add;
		}
		
		rank[p.second] = r;
	}
	
	for_(i,0,N) cout << rank[i] << endl;
}

int main() {
	cin >> N;
	solve();
	return 0;
}

C++: #include<stdio.h>

int n,team[100];

int main(){
	scanf("%d",&n);
	for(int i=0;i<n*(n-1)/2;i++){
		int a,b,c,d;
		scanf("%d%d%d%d",&a,&b,&c,&d);
		if(c==d){
			team[a]++;
			team[b]++;
		}
		if(c>d){
			team[a]+=3;
		}
		if(c<d){
			team[b]+=3;
		}	
	}
	for(int i=1;i<=n;i++){
		int res=0;
		for(int j=1;j<=n;j++){
			if(team[j]>team[i])res++;
		}
		printf("%d\n",res+1);
	}
	return 0;
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
using namespace std;
int main(){
	
	int n;
	int a,b,c,d;
	cin>>n;
	vector<int> sum(n+1,0);
	vector<int> rank(n+1);
	sum[0]=-999999;
	for(int i=0;i<n*(n-1)/2;i++){
		cin>>a>>b>>c>>d;
		if(c>d){
			sum[a]+=3;
		}
		else if(c<d)
			sum[b]+=3;
		else{
			sum[a]++;
			sum[b]++;
		}	
	}
	int k=0;
	int o=0;
	for(int i=0;i<n;i++){
		vector<int>::iterator it=find(sum.begin(),sum.end(),*max_element(sum.begin(),sum.end()));
		int j=it-sum.begin();
		if(k==0){
			k=1;
			o=sum[j];
			rank[j]=1;
		}
		else if(o==sum[j]){
			rank[j]=k;
		}
		else{
			k=i+1;
			o=sum[j];
			rank[j]=k;
		}
		sum[j]=-999999;
	}
	
	for(int i=1;i<=n;i++)
		cout<<rank[i]<<endl;
	
	
	
	
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>

using namespace std;

#define rep(i,n) for(int i=0;i<int(n);i++)
#define reps(i,n) for(int i=1;i<=int(n);i++)

int main(){
	
	int point[111]={0};
	
	int n;
	cin>>n;
	
	for(int i=0; i<(n)*(n-1)/2;i++){
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		a--;b--;
		
		if(c>d)point[a]+=3;
		if(d>c)point[b]+=3;
		if(c==d){ point[a]++; point[b]++; }
	}
	
	int cont=1;
	int rank[111];
	
	for(int i=10000;i>=0;i--){
		
		bool flg=0;
		for(int j=0;j<n;j++){
			if(point[j]==i){
				rank[j]=cont;
				flg=1;
			}
		}
		
		if(flg==1)cont++;
	}
	
	rep(i,n)printf("%d\n",rank[i]);
}