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<functional>
#include<algorithm>

using namespace std;

int main()
{
	int n;
	int score[100];
	int win[100];
	int gameteam1[10000];
	int gameteam2[10000];
	int t1score[10000];
	int t2score[10000];
	pair<pair<int, int>,pair<int,int> > sorter[100];
	pair<int, int> answer[100];

	for (int a = 0; a < 100; a++)
	{
		score[a] = 0;
		win[a] = 0;
	}

	for (int a = 0; a < 10000; a++)
	{
		gameteam1[a] = 0;
		gameteam2[a] = 0;
		t1score[a] = 0;
		t2score[a] = 0;
	}

	cin >> n;

	for (int a = 0; a < n*(n - 1) / 2; a++)
	{
		cin >> gameteam1[a] >> gameteam2[a] >> t1score[a] >> t2score[a];
	}

	for (int a = 0; a < n*(n - 1) / 2; a++)
	{
		if (t1score[a] == t2score[a])
		{
			score[gameteam1[a]-1]++;
			score[gameteam2[a]-1]++;
		}
		else
		{
			if (t1score[a] > t2score[a])
			{
				score[gameteam1[a]-1] += 3;
				win[gameteam1[a]-1]++;
			}
			else if (t1score[a] < t2score[a])
			{
				score[gameteam2[a]-1] += 3;
				win[gameteam2[a]-1]++;
			}
		}
	}

	for (int a = 0; a < n; a++)
	{
		sorter[a] = make_pair(make_pair(win[a], score[a]),make_pair(10000,a));
	}

	sort(sorter, sorter + n,greater<pair<pair<int,int>,pair<int,int> > >());

	sorter[0].second.first = 1;

	for (int a = 1; a < n; a++)
	{
		if (sorter[a].first.second == sorter[a - 1].first.second)
		{
			sorter[a].second.first = sorter[a - 1].second.first;
		}
		else
		{
			sorter[a].second.first = a + 1;
		}
	}

	for (int a = 0; a < n; a++)
	{
		answer[a] = make_pair(sorter[a].second.second, sorter[a].second.first);
	}

	sort(answer, answer + n);

	for (int a = 0; a < n; a++)
	{
		cout << answer[a].second << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <functional>

using namespace std;

typedef pair<int,int> pint;
pint team[100];
int rk[100];

int main(){
    int n,a,b,c,d;
    cin>>n;
    for(int i=0;i<n;++i) team[i]=make_pair(0,i);
    for(int i=0;i<n*(n-1)/2;++i){
        cin>>a>>b>>c>>d;
        if(c>d) team[a-1].first +=3;
        else if(c<d) team[b-1].first +=3;
        else{
            ++team[a-1].first,++team[b-1].first;
        }
    }
    int r=0,t=334,t2=0;
    sort(team,team+n,greater<pint>());
    for(int i=0;i<n;++i){
        if(t==team[i].first){rk[team[i].second]=r;t2++;}
        else{r+=t2;rk[team[i].second]=++r;t2=0;}
        t=team[i].first;
    }
    for(int i=0;i<n;++i) cout<<rk[i]<<endl;
    return 0;
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int n; cin>>n;
	pair<int,int> p[100];
	for(int i=0;i<n;i++)
		p[i]=make_pair(0,i);
	
	for(int i=0;i<(n-1)*n/2;i++){
		int a,b,c,d; cin>>a>>b>>c>>d;
		if(c>d)
			p[a-1].first+=3;
		else if(c<d)
			p[b-1].first+=3;
		else{
			p[a-1].first++;
			p[b-1].first++;
		}
	}
	sort(p,p+n);
	reverse(p,p+n);
	
	int q[100];
	for(int i=0;i<n;i++)
		q[i]=!i||p[i].first<p[i-1].first?i+1:q[i-1];
	for(int i=0;i<n;i++)
		p[i]=make_pair(p[i].second,q[i]);
	sort(p,p+n);
	
	for(int i=0;i<n;i++)
		cout<<p[i].second<<endl;
	
	return 0;
}

C++: #include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
int n,a,b,c,d,jun[101],x;
typedef pair<int,int> P;
P t[101];

bool cmp(const P& a,const P& b){
	return a.first == b.first ? a.second < b.second : a.first > b.first;
}

int main()
{
	cin>>n;
	for(int i=1;i<=n;i++) t[i].second=i;
	for(int i=1;i<=n*(n-1)/2;i++){
		cin>>a>>b>>c>>d;
		if(c>d) t[a].first+=3;
		else if(c<d) t[b].first+=3;
		else {t[a].first++; t[b].first++;}
	}
	sort(t+1,t+n+1,cmp);
	for(int i=1;i<=n;i++){
		if(i>1&&t[i].first==t[i-1].first){
			jun[t[i].second]=x;
		}
		else{
			jun[t[i].second]=i;
			x=i;
		}
	}
	for(int i=1;i<=n;i++){
		cout<<jun[i]<<endl;	
	}
}

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

int main() {
  int N; cin >> N;
  vector<pair<int ,int> > v(N);
  for(int i = 0; i < N; ++i) v[i].second = i;
  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) {
      v[a].first += 3;
    } else if(c < d) {
      v[b].first += 3;
    } else {
      v[a].first += 1;
      v[b].first += 1;
    }
  }
  sort(v.begin(), v.end(), greater<pair<int, int> >());
  vector<int> rank(N);
  for(int i = 0, k = 1; i < N; ++i) {
    if(i && v[i-1].first != v[i].first) k = i + 1;
    rank[v[i].second] = k;
  }
  for(int i = 0; i < N; ++i) {
    cout << rank[i] << endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int w[100 + 3] ={0};
int n;
int r[100 + 3] ={0}; 

int main(){
    cin >> n;
    for(int i = 0;i < n*(n-1)/2;i++){
        int a, b, pa, pb;
        cin >> a >> b >> pa >> pb;
        if(pa > pb) {
            w[a] += 3;
        }
        else if(pa ==pb){
            w[a] += 1;
            w[b] += 1;
        }
        else{
            w[b] += 3;
        }
    }
    for(int i = 1;i <= n;i++){
        for(int j = 1; j <= n;j++){
            if(w[i] < w[j]){
                r[i] += 1;
            }
        }
    }    
    for(int i = 1;i <= n;i++){
        cout << r[i] + 1 << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int N, i, p, q, j, flg;
int GET[101][101], PNT[101], Order[101];
int main(){
    cin >> N;
    for (i=1; i<=N; i++) { PNT[i] = 0; Order[i]=1;}
    for (p=1; p<=N; p++) {
        for (q=1; q<=N; q++) {
            GET[q][p] = 9999;
        }
    }
    for (i=1; i<=(N*(N-1)/2); i++) {
        cin >> p >> q;
        cin  >> GET[p][q] >> GET[q][p];
    }
    for (p=1; p<=N; p++) {
        for (q=p+1; q<=N; q++) {
            if(p == q) { continue;}
            if (GET[p][q] > GET[q][p]) {
               PNT[p] += 3;
            } else {
                if (GET[p][q] > GET[q][p]) {
                PNT[p] += 3;
                } else {
                    PNT[p] += 1; PNT[q] += 1;
                }
            }
        }
     }
     for (p=1; p<=N; p++) {
         for (q=1; q<=N; q++) {
             if(PNT[p]<PNT[q]){Order[p]++;}
         }
     }
     for (i=1; i<=N; i++) {
         cout << Order[i] << endl;
     }
     return 0;
}