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<queue>
using namespace std;
int main() {
	int n; cin >> n;
	int score[114] = {}, rank[114];
	priority_queue<pair<int, int>>p;
	for (int i = 0; i < n*(n - 1) / 2; i++) {
		int a, b, c, d; cin >> a >> b >> c >> d;
		if (c > d)score[a] += 3;
		else if (c < d)score[b] += 3;
		else { score[a]++; score[b]++; }
	}
	for (int i = 1; i <= n; i++) 
		p.push(make_pair(score[i], i));
	int mem1 = 1, mem2 = 0;//mem1:score, mem2:rank
	for (int i = 1; i <= n; i++) {
		pair<int, int>pr = p.top();
		//pr.first:score, pr.second:id
		p.pop();
		if (pr.first == mem1) { rank[pr.second] = mem2; }
		else { rank[pr.second] = i; mem2 = i; mem1 = pr.first; }
	}
	for (int i = 1; i <= n; i++) {
		cout << rank[i];
		cout << '\n';
	}
}

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

using namespace std;

int N;
int TeamInfo[101];

void solve() {
	int ranking;

	for (int i = 1; i <= N; ++i) {
		ranking = 1;
		for (int j = 1; j <= N; ++j) {
			if (TeamInfo[i] < TeamInfo[j]) {
				++ranking;
			}
		}
		cout << ranking << endl;
	}
}

int main() {
	int cnt, a, b, c, d;

	cin >> N;
	cnt = N*(N - 1) / 2;
	for (int i = 0; i < cnt; ++i) {
		cin >> a >> b >> c >> d;
		if (c > d) {
			TeamInfo[a] += 3;
		}
		else if (c < d) {
			TeamInfo[b] += 3;
		}
		else {
			++TeamInfo[a];
			++TeamInfo[b];
		}
	}
	solve();

	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n;
	int t[101],z[101];;
	int a,b,c,d;
	int i,j;
	
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		t[i]=0;
		z[i]=1;
	}
	for(i=0;i<n*(n-1)/2;i++){
		scanf("%d %d %d %d",&a,&b,&c,&d);
		if(c>d){
			t[a]+=3;
		}
		else if(c<d){
			t[b]+=3;
		}
		else if(c==d){
			t[a]+=1;
			t[b]+=1;
		}
	}
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
			if(t[i]>t[j]){
				z[j]++;
			}
		}
	}
	for(i=1;i<=n;i++){
		printf("%d\n",z[i]);
	}
	return 0;
}

C++: #include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <random>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
#include <chrono>
#include <cstdlib>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
const double pi = acos(-1);
typedef pair<int, int> P;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EPS 1e-4
#define OUTPUT(i) (cout << (ll)i << endl)
#define ALL(a) ((a).begin(), (a).end())

bool operator<(const pair<ll, ll> &a, const pair<ll, ll> &b)
{

    if (a.first == b.first)
        return a.second < b.second;

    return a.first < b.first;
}

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

int arr[101];
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    //cout << fixed << setprecision(15);

    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)
        {
            arr[A] += 3;
        }
        else if (C < D)
        {
            arr[B] += 3;
        }
        else
        {
            arr[A] += 1;
            arr[B] += 1;
        }
    }
    vector<int> v;
    for (int i = 0; i < N; ++i)
    {
        v.push_back(arr[i]);
    }
    sort(v.rbegin(), v.rend());

    int idx = 1;
    map<int, int> mp;
    for (int i = 0; i < N; ++i)
    {
        if (mp.find(v[i]) == mp.end())
            mp[v[i]] = idx;

        idx++;
    }

    for (int i = 0; i < N; ++i)
    {
        cout << mp[arr[i]] << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
int main() {
	int N;
	std::cin >> N;
	std::vector<int>sum(N), sort(N);
	for (int i = 0; i < (N - 1)*N / 2; i += 1) {
		int a, b, c, d;
		std::cin >> a >> b >> c >> d;
		if (c > d) {
			sum[a - 1] += 3;
		}
		else if (d > c) {
			sum[b - 1] += 3;
		}
		else {
			sum[a - 1] += 1;
			sum[b - 1] += 1;
		}
	}
	for (int i = 0; i < N; i += 1)
		sort[i] = sum[i];
	std::sort(sort.begin(), sort.end());
	for (int i = 0; i < N; i += 1)
		for (int j = N-1; j >= 0; j -= 1) {
			if (sum[i] == sort[j]) {
				std::cout << N-j << std::endl;
				break;
			}
		}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int INF=-5;
int main(){
	int n,ten[107]={0},tenc[107]={0},ans[107]={0};
	cin>>n;
	for(int i=0;i<n*(n-1)/2;i++){
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		if(c>d)ten[a]+=3;
		else if(c<d)ten[b]+=3;
		else ten[a]++,ten[b]++;
	}
	//for(int i=1;i<=n;i++)cout<<ten[i];int ans[107]={0};
		for(int i=1;i<=n;i++)tenc[i]=ten[i];
		
		for(int i=1;i<=n;i++){
			int tmp=-1,jun=-1;
			for(int j=1;j<=n;j++){
				if(tmp<tenc[j])tmp=tenc[j],jun=j;
			}
			tenc[jun]=-1;
			ans[jun]=i;
		}
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				if(ten[i]==ten[j])(ans[i]>ans[j])?ans[i]=ans[j]:ans[j]=ans[i];
			}
		}
	for(int i=1;i<=n;i++)cout<<ans[i]<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int all[1000][1000];
int a,b,c,d,N;
int main(){
    cin>>N;
    for(int i=0;i<N*(N-1)/2;i++){
        cin>>a>>b>>c>>d;
        a=a-1;b=b-1;
        if(c>d){all[a][0]=all[a][0]+3;}
        if(c<d){all[b][0]=all[b][0]+3;}
        if(c==d){all[a][0]=all[a][0]+1;all[b][0]=all[b][0]+1;}
    }
    for(int u=0;u<N;u++){ all[u][1]=1; }
    for(int i=0;i<N;i++){
        for(int u=0;u<N;u++){
            if(all[i][0]>all[u][0]){ all[u][1]++;}
        }
    }
    for(int o=0;o<N;o++){ cout<<all[o][1]<<endl; }
}

C++: #include <cstdio>
using namespace std;

int n;
int score[100], rank[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);
		a--;
		b--;
		if(c > d){
			score[a] += 3;
		}else if(c < d){
			score[b] += 3;
		}else{
			score[a]++; score[b]++;
		}
	}
	for(int i = 0; i < n; i++) rank[i] = 1;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			if(score[i] < score[j]) rank[i]++;
		}
	}
	for(int i = 0; i < n; i++) printf("%d\n", rank[i]);
	return 0;
}

C++: #include<iostream>
using namespace std;
#include<algorithm>
int main()
{
	int sta[101]={},stb[101]={};
	int A,B,C,D,i,n,m,j;
	cin>>n;
	for(i=1;i<=n;i++){
		sta[i]=i;
	}
	m=n*(n-1)/2;
	for(i=0;i<m;i++){
		cin>>A>>B>>C>>D;
		if(C>D){
			stb[A]+=3;
		}
		else if(C<D){
			stb[B]+=3;
		}
		else{
			stb[B]++;
			stb[A]++;
		}
	}
	for(i=1;i<=n-1;i++){
		for(j=i+1;j<=n;j++){
			if(stb[i]<stb[j]){
				m=stb[i];
				stb[i]=stb[j];
				stb[j]=m;
				m=sta[i];
				sta[i]=sta[j];
				sta[j]=m;

			}

		}
	}
	for(i=1;i<=n;i++){
		cout<<sta[i]<<endl;
	}
	return 0;