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>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> P3;
typedef pair<P ,P> PP;
constexpr ll MOD = ll(1e9) + 7;
constexpr int IINF = INT_MAX;
constexpr ll LLINF = LLONG_MAX;
constexpr int MAX_N = int(2e5) + 5;
constexpr double EPS = 1e-9;
constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i > 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define ALL(v) (v).begin(), (v).end()

int main() {
    int n, r[100];
    vector<P> p;
    cin >> n;
    p.resize(n);
    REP(i,n){
        p[i].first = 0;
        p[i].second = i;
    }
    REP(i,n*(n-1)/2){
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        a--; b--;
        if(c > d) p[a].first += 3;
        if(c < d) p[b].first += 3;
        if(c == d){
            p[a].first += 1;
            p[b].first += 1;
        }
    }
    SORTR(p);
    REP(i,n){
        if(i>0 && p[i-1].first==p[i].first){
            r[p[i].second] = r[p[i-1].second];
        }
        else r[p[i].second] = i+1;
    }
    REP(i,n){
        cout << r[i] << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	long long n,teama,teamb,score[1001]={0},c,d,number[1001],kari[1001];
	cin>>n;
	for(int i=0;i<n*(n-1)/2;++i){
		cin>>teama>>teamb;
		cin>>c>>d;
		if(c>d){
			score[teama]+=3;
		}
		else if(c<d){
			score[teamb]+=3;
		}
		else{
			score[teama]+=1;
			score[teamb]+=1;
		}

	}
	int max=-1,memo;
	for(int j=1;j<=n;++j){
		for(int i=1;i<=n;++i){
			if(max<score[i]){
				max=score[i];
				memo=i;
			}
		}
		number[memo]=j;
		for(int k=1;k<=n;++k){
			if(memo==k){
				continue;
			}
			if(score[memo]==score[k]&&score[memo]!=-1&&score[k]!=-1){
				number[k]=j;
				score[k]=-1;
				++j;
			}
		}
		score[memo]=-1;
		max=-1;
	}
	
	for(int i=1;i<=n;++i){
		cout<<number[i]<<endl;
	}
	return 0;
}

C++: #include <stdio.h>

int main()
{
    int n;
    int team[128] = {0};
    int lank[128];
    int i, j;

    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);
        a--, b--;
        if (c > d) team[a] += 3;
        else if (c < d) team[b] += 3;
        else team[a]++, team[b]++;
    }

    i = 0;
    while (i < n){
        int maxi = 0;
        int cnt = 0;

        for (j = 0; j < n; j++){
            if (maxi < team[j]) maxi = team[j];
        }
        for (j = 0; j < n; j++){
            if (team[j] == maxi){
                team[j] = 0;
                lank[j] = i + 1;
                cnt++;
            }
        }
        i += cnt;
    }

    for (i = 0; i < n; i++) printf("%d\n", lank[i]);

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)

int main(){
  int N; cin>>N;
  vector<int> sc(N,0);
  rep(i,N*(N-1)/2){
    int a,b,c,d; cin>>a>>b>>c>>d;
    
    if(c>d) sc[a-1]+=3;
    else if(c<d) sc[b-1]+=3;
    else{ ++sc[a-1]; ++sc[b-1]; }
  }
  rep(i,N){
    int x=1;
    rep(j,N) if(j!=i && sc[i]<sc[j]) ++x;
    cout<<x<<endl;
  }
  return 0;
}

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

C++: #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i, n) for(int i = n; i >= 0; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define SORT(v) sort((v).begin(), (v).end())
#define REV(v) sort((v).begin(), (v).end(), greater<int>())
#define INF 1000000007
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a*b/gcd(a,b);};
int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int main() {
  cin.tie(0);  cout.tie(0);
  ios::sync_with_stdio(false);

  int n;
	cin >> n;
	int a, b, c, d;
	int poi[n] = {};
	int N = n * (n - 1) / 2;
	P rank[n];

	rep(i, N) {
		cin >> a >> b >> c >> d;
		if(c > d) {
			poi[a - 1] += 3;
		} if(c == d) {
			poi[a - 1]++;
			poi[b - 1]++;
		} if(c < d) {
			poi[b - 1] += 3;
		}
	}
	//rep(i, n) cout << poi[i] << " ";
	rep(i, n) {
		rank[i].first = poi[i];
	}
	sort(rank, rank + n, greater<P>());
	rep(i, n) {
		if(!i) rank[i].second = 1;
		else if(rank[i].first == rank[i - 1].first) rank[i].second = rank[i - 1].second;
		else rank[i].second = i + 1;
	}
	rep(i, n) {
		int np = poi[i];
		rep(j, n) {
			if(rank[j].first == np) {
				cout << rank[j].second << endl;
				break;
			}
		}
	}
	//rep(i, n) cout << rank[i].first << " " << rank[i].second << endl;
  return 0;
}

C++: #include<cstdio>
#include<algorithm>
using namespace std;
typedef pair<int,int>P;
P box[101];
int main(void)
{
	int n,num[101],i,a,b,c,d,j;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		box[i].first=0;
		box[i].second=i;
	}
	for(i=1;i<n;i++){
		for(j=i+1;j<=n;j++){
			scanf("%d %d %d %d",&a,&b,&c,&d);
			if(c>d){
				box[a].first+=3;
			}
			if(c<d){
				box[b].first+=3;
			}
			if(c==d){
				box[a].first++;
				box[b].first++;
			}
		}
	}
	sort(box+1,box+n+1);
	box[n+1].first=-1;
	for(i=n;i>=1;i--){
		if(box[i].first==box[i+1].first){
			num[box[i].second]=num[box[i+1].second];
		}
		else{
			num[box[i].second]=n-i+1;
		}
	}
	for(i=1;i<=n;i++){
		printf("%d\n",num[i]);
	}
	return 0;
}

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

int main()
{
  int n;
  cin >> n;
  int team[n + 5] = {0};
  int m = n * (n - 1) / 2;
  for (int i = 0; i < m; i++){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (c > d) team[a] += 3;
    else if (c < d) team[b] += 3;
    else {
      team[a]++;
      team[b]++;
    }
  }

  for (int i = 1; i <= n; i++){
    int res = 1;
    for (int j = 1; j <= n; j++) if (team[i] < team[j]) res++;
    cout << res << '\n';
  }
}