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 <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>

using namespace std;

int main(){
	
	int team[200], t_rank[200];
	
	int N;
	
	cin >> N;
	
	int a, b, c, d;
	
	for(int i = 0; i <= N; i++){
		team[i] = 0;
	}
	
	for(int i = 0; i < N * (N - 1) / 2; i++){
		cin >> a >> b >> c >> d;
		if(c > d){
			team[a] += 3;
		}else if(c < d){
			team[b] += 3;
		}else if(c == d){
			team[a]++;
			team[b]++;
		}
	}
	
	int rank = 1;
	
	int count;
	
	for(int i = N * 3; i >= 0; i--){
		count = 0;
		for(int j = 1; j <= N; j++){
			if(team[j] == i){
				count++;
				t_rank[j] = rank;
			}
		}
		rank += count;
	}
	
	for(int i = 1; i <= N; i++){
		cout << t_rank[i] << endl;
	}
	
	return 0;
}

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]++; }
	}
	
	
	for(int i=0;i<n;i++){
		int rank=1;
		for(int j=0;j<n;j++){
			if(point[i]<point[j])rank++;
		}
		printf("%d %d\n",rank,point[i]);
	}
}

C++: #include <stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
typedef pair<int,int> pi;
#define F first
#define S second
const int N=1e2+10;
int main(){
    int n,a,b,c,d,tot;
    pi val[N];
    scanf("%d",&n);
    for(int i=1;i<=n;i++)val[i]={0,i};
    tot=(n*(n-1))/2;
    while(tot--){
        scanf("%d%d%d%d",&a,&b,&c,&d);
        if(c==d){
            val[a].F++;
            val[b].F++;
        }
        else if(c>d)val[a].F+=3;
        else val[b].F+=3;
    }
    sort(val+1,val+1+n);
    for(int i=1;i<=n;i++)printf("%d\n",val[i].S);
}

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

using namespace std;

int main(){

	int n;
	cin >> n;
	int k[102]={0};
	int s[102]={0};
	for(int i = 0;i < n*(n-1)/2;i++){
		int a,b,c,d;
		cin >> a >> b >> c >> d;
		if(c > d){
			k[a] += 3;
		}else if(d > c){
			k[b] += 3;
		}else{
			k[a] += 1;
			k[b] += 1;
		}
		s[a-1] = k[a];
		s[b-1] = k[b];
	}
	sort(s,s+n,greater<int>());
	for(int i = 1;i <= n;i++){
		for(int j = 0;j < n;j++){
			if(s[j] == k[i]){
				cout << j+1 << 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;
	while (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 <iostream>

using namespace std;
 
int main(){
    int n,team1,team2,Point[101],po1,po2,cnt;
 
    for( int i = 0 ; i < 101 ; i++ ) Point[i] = 0;
   
    cin >> n;
    for( int i = 0; i < n*(n-1)/2 ; i++ ){
 
	cin >> team1 >> team2 >> po1 >> po2;
	if( po1 > po2 ) Point[team1] += 3;
	else if( po1 < po2 ) Point[team2] += 3;
	else{
	    Point[team1]++; Point[team2]++;
	}
    }
 
    for( int i = 1 ; i <= n ; i++ ){
	cnt = 1;
	for( int j = 1 ; j <= n ; j++ ){
	    if( Point[i] < Point[j] ) cnt++;
	}
	cout << cnt << endl;
    }
    return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n,i,j,a[101],b[101],c[101],d[101],p=0,team[101],team2[101],team3[101],result[101],cnt=0,z;

cin>>n;

for(i=0;i<=n;i++){
	a[i]=0;
	b[i]=0;
	c[i]=0;
	d[i]=0;
	team[i]=0;
	team2[i]=0;
	team3[i]=0;
	result[i]=0;
}

p=n*(n-1)/2;

for(i=1;i<=p;i++){
	cin>>a[i]>>b[i]>>c[i]>>d[i];

	if(c[i]>d[i]){
	team[a[i]]=team[a[i]]+3;
	}

	else if(c[i]<d[i]){
	team[b[i]]=team[b[i]]+3;
	}

	else{
	team[a[i]]=team[a[i]]+1;
	team[b[i]]=team[b[i]]+1;
	}

}

for(i=1;i<=n;i++){
team2[i]=team[i];
}
for(i=1;i<=n;i++){
	if(team[i]<=team[i+1]){
	z=team[i];
	team[i]=team[i+1];
	team[i+1]=z;
	}
}
for(i=1;i<=n;i++){
	for(j=1;j<=n;j++){
		if(team[i]==team2[j]){
		team3[j]=i;
		team2[j]=-1;
		}
	}
for(i=1;i<=n;i++){
printf("%d\n",team3[i]);
}

return 0;
}

C++: #include<cstdio>
#include <iostream>
#include <string>
#include<algorithm>
#include <map>
#pragma warning(disable:4786)  // VisualC++6.0の警告対策



using namespace std;

#define ll long long
#define SINT(n) scanf("%d",&n);
#define SINT2(n,m) scanf("%d %d",&n,&m);
#define SINT3(n,m,o) scanf("%d %d %d",&n,&m,&o);
#define SINT4(n,m,o,p) scanf("%d %d %d %d",&n,&m,&o,&p);
#define SLL(n) scanf("%lld",&n);
#define SST(s) scanf("%s",&s);

#define PINT(n) printf("%d",(int)(n));
#define PINT2(n,m) printf("%d %d",(int)(n),(int)(m));
#define PLL(n) printf("%lld",(long long)(n));
#define PST(s) printf("%s",(s));
#define PCH(s) printf("%c",(s));

#define PINTN(n) printf("%d\n",(int)(n));
#define PINT2N(n,m) printf("%d %d\n",(int)(n),(int)(m));
#define PLLN(n) printf("%lld\n",(long long)(n));
#define PSTN(s) printf("%s\n",(s));
#define PCHN(s) printf("%c\n",(s));

#define PSP() printf(" ");
#define PN() printf("\n");


#define dlp(i) while(i-->0)
#define ulp(i) for(ll _hoge_counter_hoge_=i,i=0;i<_hoge_counter_hoge_;i++)

#define lp(i) for(ll _hoge_counter_hoge_=i;_hoge_counter_hoge_--;)
#define lpp(i,to) for(i=0;i<to;i++)
#define lpft(i,from,to) for(i=from;i<to;i++)


map<ll, map<ll, short> > memo[50][50][4];

char Map[60][60];

int main(){

	int N;
	int i,j,k;
	int a,b,c,d;
	int t[100];

	//fill( t, t+sizeof(t), 0 );
	std::memset(t,sizeof(t),0);

	SINT(N);

	
	lpp(i,N*(N-1)/2){
		SINT4(a,b,c,d);
		if(c>d){
			t[a-1]+=3;
		}
		if(c<d){
			t[b-1]+=3;
		}
		if(c==d){
			t[a-1]++;
			t[b-1]++;
		}
	}

	lpp(i,N){
		a=1;
		lpp(j,N){
			if(t[j]>t[i]) a++;
		}
		PINTN(a);
	}
	
	return 0;
}