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 <algorithm>
#include <vector>
using namespace std;

struct Team{
    int id;
    int win;
    bool operator<(const Team& r) const {
        return win == r.win ? id < r.id : win > r.win;
    }
    Team(){}
    Team(int a, int b) : id(a), win(b) {}
};

int main(){
    int n,i,a,b,c,d;
    cin >> n;
    vector<Team> t(n);
    for(i=0;i<n;i++){
        t[i] = Team(i, 0);
    }
    for(i=0;i<n*(n-1)/2;i++){
        cin>>a>>b>>c>>d;
        a--;b--;
        if(c > d){
            t[a].win += 3;
        }else if(c < d){
            t[b].win += 3;
        }else{
            t[a].win += 1; t[b].win += 1;
        }
    }
    sort(t.begin(), t.end());
    int rw = t[0].win, cnt = 1, df = 0;
    vector<int> rank(n);
    for(i=0;i<n;i++){
        if(rw == t[i].win){
            rank[ t[i].id ] = cnt;
            df++;
        }else{
            rank[ t[i].id ] = cnt+df;
            cnt += df;
            rw = t[i].win;
            df = 1;
        }
    }
    for(i=0;i<n;i++){
        cout << rank[i] << endl;
    }
    return 0;
}

C++: #include <stdio.h>

typedef struct {
	int id;
	int rank;
	int score;
} TEAM;

TEAM team[200];

int cmp_score(TEAM *A, TEAM *B)
{
	return (B->score - A->score);
}

int cmp_id(TEAM *A, TEAM *B)
{
	return (A->id - B->id);
}

int main(void)
{
	int N;
	int i, j;
	
	for (i = 0; i < 200; i++){
		team[i].id = i;
	}
	
	scanf("%d", &N);
	for (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 - 1].score += 3;
		}
		else if (c == d){
			team[a - 1].score += 1;
			team[b - 1].score += 1;
		}
		else {
			team[b - 1].score += 3;
		}
	}
	
	qsort(team, N, sizeof(TEAM), cmp_score);
	
	for (i = 1; i <= N; i++){
		if (i == 1){
			team[i].rank = 1;
		}
		else if (team[i - 1].score == team[i].score){
			team[i].rank = team[i - 1].rank;
		}
		else if (team[i - 1].score > team[i].score){
			team[i].rank = i;
		}
	}
	
	qsort(team, N, sizeof(TEAM), cmp_id);
	
	for (i = 0; i < N; i++){
		printf("%d\n", team[i].rank + 1);
	}
	
	return 0;
}

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(score[a], win[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.first == sorter[a - 1].first.first)
		{
			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<cstdio>
#include<string>
#include<algorithm>

using namespace std;

int main(){
  int n;
  int t[100] = {0};
  cin >> n;
  for(int i = 0; i < n * (n - 1) / 2; i++){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    a--;b--;c--;d--;
    if(c > d)
      t[a] += 3;
    else if(c < d)
      t[b] += 3;
    else if(c == d){
      t[a]++;
      t[b]++;
    }
  }
  for(int i = 0; i < n; i++){
    int ans = 1;
    for(int j = 0; j < n; j++){
      if(t[i] < t[j])
	ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}

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

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;} //&&c<='9'
_in() {return in(gcu());}
_sc(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
//_sc(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
template <typename H,typename... T> _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
template <typename T>
_vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
//_vo(string &s){for (char c: s) pcu(c);}
template <typename H,typename... T> _vo(H&& h, T&&... t){out(h);out(move(t)...);}
//template <typename T> _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
_vl(){out('\n');}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	int n = in();
	vector<int> g(n);
	for (int i = n * (n - 1) / 2; i--;) {
		int a = in() - 1, b = in() - 1, c = in(), d = in();
		if (c == d)
			g[a]++, g[b]++;
		else
			g[c > d ? a : b] += 3;
	}
	map<int, int> m;
	for (int i: g)
		m[i]++;
	for (auto &i: m)
		i.second = (n -= i.second) + 1;
	for (int i: g)
		outl(m[i]);
}

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

int team[100], num[100], ans[100];

int main(){
	int n;
	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){
			team[a]++;
			team[b]++;
		} else if(c > d){
			team[a] += 3;
		} else{
			team[b] += 3;
		}
	}
	for(int i = 0; i < n; i++) num[i] = team[i];
	sort(num,num+n,greater<int>());
	for(int i = 0; i < n; i++){
		if(i != 0 && num[i] == num[i-1]) continue;
		for(int j = 0; j < n; j++){
			if(team[j] == num[i]) ans[j] = i+1;
		}
	}
	for(int i = 0; i < n; i++) printf("%d\n", ans[i]);
}