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 unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
typedef vector<vector<int>> mat;

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()

const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const ll INF = 1<<30;
const ll mod = 1000000000 + 7;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;

//#define int long long
#define addm(X, Y) (X) = ((X) + ((Y) % mod) + mod) % mod



signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int cnt[n] = {};
    rep(i, n * (n - 1) / 2) {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        a--; b--;
        if (c > d) cnt[a] += 3;
        else if (c == d) {
            cnt[a]++;
            cnt[b]++;
        }
        else cnt[b] += 3;
    }
    int score[305] = {};
    rep(i, n) score[cnt[i]]++;
    int total[305] = {};
    rrep2(i, 303, 0) {
        total[i] = total[i + 1] + score[i];
    }   
    rep(i, n) {
        cout << total[cnt[i]] - score[cnt[i]] + 1 << endl;
    }
}

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

int main() {
    int N, m, p1, p2, g1, g2;
    auto comp = [](const pair<int, int> &a, const pair<int, int> &b) {return a.second > b.second; };
    std::scanf("%d", &N);
    deque<pair<int, int> > v;
    int res[N+1];
    v.push_back({0, 0});
    for (int i = 1; i <= N; i++) v.push_back({i, 0});
    m = N * (N-1) / 2;
    for (int i = 0; i < m; i++) {
        std::scanf("%d %d %d %d", &p1, &p2, &g1, &g2);
        if (g1 == g2) v[p1].second += 1, v[p2].second += 1;
        else if (g1 > g2) v[p1].second += 3;
        else v[p2].second += 3;
    }
    v.pop_front();
    int prev, curr_pos = 1, prevpos_num = 1;
    std::sort(v.begin(), v.end(), comp);
    prev = v[0].second; res[v[0].first] = 1;
    for (int i = 1; i < v.size(); i++) {
        if (v[i].second != prev) {
            res[v[i].first] = curr_pos = curr_pos + prevpos_num;
            prev = v[i].second;
            prevpos_num = 1;
        }
        else {
            res[v[i].first] = curr_pos;
            prevpos_num++;
        }
    }
    for (int i = 1; i <= N; i++) printf("%d\n", res[i]);
    return 0;
}

C++: #include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <sstream>
#include <string>
#include <map>
#include <set>
using namespace std;

#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()

int main(){
    int n;
    cin >> n;

    vector<int> ps(n,0);
    rep(i,n*(n-1)/2){
        int a,b,sa,sb;
        cin >> a >> b >> sa >> sb;
        if(sa>sb) {
            ps[a-1] += 3;
        }else if(sa == sb) {
            ps[a-1]++;
            ps[b-1]++;
        }else{
            ps[b-1]+=3;
        }
    }

    vector<int> v(ps);
    sort(all(v));

    rep(i,n){
        rep(j,n){
            if(ps[i] == v[j]) {
                cout << j + 1 << endl;
                break;
            }
        }
    }

    return EXIT_SUCCESS;
}

C++: #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "functional"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-8;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


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

	cin >> N;
	vector<int>ans(N);
	for (int i = 0; i < N*(N - 1) / 2; i++) {
		cin >> L >> R >> H >> W;
		L--;
		R--;
		if (H > W)ans[L] += 3;
		else if (H < W)ans[R] += 3;
		else {
			ans[L]++;
			ans[R]++;
		}
	}
	for (auto i : ans) {
		//cout << i << " ";
		int ret = 1;
		for (auto j : ans)ret += i < j;
		cout << ret << endl;
	}
	return 0;
}

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

using namespace std;

int main(void)
{
int k,n,a[5001],b[5001],c[5001],d[5001],t[5001]={0};
int cnt;
cin >> n;
k=n*(n-1)/2;
for(int i=0;i<k;i++)
cin >> a[i] >> b[i] >> c[i] >> d[i];
for(int i=0;i<k;i++){
if(c[i]>d[i])
t[a[i]]+=3;
else if(c[i]<d[i])
t[b[i]]+=3;
else{
t[a[i]]+=1;
t[b[i]]+=1;}}

for(int i=1;i<=n;i++){
cnt=1;
for(int j=1;j<=n;j++){
if(t[i]<t[j])
cnt++;}
cout << cnt << endl;
}
return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
typedef pair<int,int> Pii;
int main(){
	int n;
	scanf("%d",&n);
	map < int , int > M;
	n = n * (n - 1) / 2;
	for(int i = 0; i < n; i++){
		int a,b,c,d;
		cin >> a >> b >> c >> d;
		M[a] += (c > d) ?  3 : (c == d) ? 1 : 0;
		M[b] += (d > c) ?  3 : (c == d) ? 1 : 0;
	}
	Pii p[128];
	map<int,int>::iterator it = M.begin();
	int len = 0;
	for(it = M.begin(); it != M.end(); it++){
		p[len].first = it->second;
		p[len].second = it->first;
		len++;
	}
	sort(p,p+len);
	reverse(p,p+len);
	
	int rank = 1;
	for(int i = 0; i < len ;){
		int x = p[i].first;
		int j;
		for(j = i ; p[j].first == x; j++){
			p[j].first = rank;
		}
		rank += (j-i);
		i += (j-i);
	}

	for(int i = 0; i < len; i++){
		swap(p[i].first,p[i].second);
	}
	sort(p,p+len);
	for(int i = 0; i < len; i++){
		printf("%d\n",p[i].second);
	}
	return 0;
}