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>
using namespace std;

int main() {
	int n ,team1 ,team2 ,score1 ,score2 ,a[100]={} ,save[100]={};
	cin>>n;
	for(int i=0;i<(n*(n-1)/2);i++){
		team1=0;
		team2=0;
		score1=0;
		score2=0;
		cin>>team1>>team2>>score1>>score2;
		if(score1>score2){
			a[team1]+=3;
		}
		else if(score1<score2){
			a[team2]+=3;
		}
		else if(score1==score2){
			a[team1]++;
			a[team2]++;
		}
	}
	for(int i=1;i<=n;i++){
		save[i]=a[i];
	}
	sort(a,a+n+1);
	for(int i=1;i<=n;i++){
		for(int l=1;l<=n;l++){
				if(a[l]==save[i]){
				if(a[l]==a[l+1]){
					
				}
				else{
						cout<<n-l+1<<endl;
						break;
				}	
			}
		}
	}

return 0;
}

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

int main() {
    int n;
    cin >> n;
    pair <int, int> pii[n];
    rep (i, n) pii[i] = make_pair(0, i + 1);

    rep (i, n * (n - 1) / 2) {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        a--, b--;
        if (c == d) pii[a].first += 1, pii[b].first += 1;
        else        c > d ? pii[a].first += 3 : pii[b].first += 3;
    }

    sort(pii, pii + n);
    map <int, int> mp;
    int num = 1;
    rep (i, n) {
        num = i + 1;
        while(1) {
            if (i >= n) break;
            mp[pii[n - 1 - i].second] = num;
            if (pii[n - 1 - i].first == pii[n - 1 - i - 1].first) i++;
            else break;
        }
    }

    rep (i, n) cout << mp[i + 1] << endl;

    return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n, team[101] = { 0 }, name[100] , a, b, c, d, hoz, iya;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		name[i]=1;
	for (int i = 1; i <= n*(n - 1) / 2; i++)
	{
		cin >> a >> b >> c >> d;
		if (c > d)
			team[a] += 3;
		else if (c == d)
		{
			team[a]++;
			team[b]++;
		}
		else
			team[b] += 3;
	}
	for (int i = 1; i <= n; i++)
		cout << team[i] << endl<<endl;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			if (team[i] < team[j])
			{
				name[i]++;

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

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

using namespace std;

int main()
{
    int N;
    int A,B,C,D;
    vector<pair<int,int> > P;
    vector<int> R;

    cin >> N;

    P.push_back({1000000000,-1});
    R.resize(N+1);

    for(int i=1; i<=N; ++i) P.push_back({0,i});

    for(int i=0; i<N*(N-1)/2; ++i) {
        cin >> A >> B >> C >> D;
        if(C==D) {
            ++P[A].first;
            ++P[B].first;
        } else if(C>D) {
            P[A].first+=3;
        } else {
            P[B].first+=3;
        }
    }

    sort(P.rbegin(),P.rend());

    int rnk=1;

    R[P[1].second]=1;

    for(int i=2; i<=N; ++i) {
        if(P[i-1].first!=P[i].first) rnk=i;
        R[P[i].second]=rnk;
    }

    for(int i=1; i<=N; ++i) {
        cout << R[i] << endl;
    }

    return 0;
}

C++: // JOI11-quest2.cpp : Defines the entry point for the console application.
//
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>


int main(void)
{
	int team, point[101] = { 0 };
	scanf("%d", &team);

	int a, b, c, d;
	for (int i = 0; i < (team * (team - 1)) / 2; i++) {
		scanf("%d %d %d %d", &a, &b, &c, &d);

		if (c > d) {
			point[a] += 3;
		}
		else if (c < d) {
			point[b] += 3;
		}
		else {
			point[a] += 1;
			point[b] += 1;
		}
	}

	int rank;
	for (int i = 1; i <= team; i++) {
		rank = 1;
		for (int j = 1; j <= team; j++) {
			if (i == j) {
				continue;
			}
			if (point[i] < point[j]) {
				rank++;
			}
		}
		printf("%d\n", rank);
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
using namespace std;

int main(void){
	int n;cin>>n;
	vector<int> points(n,0);
	for(int i=0;i<n*(n-1)/2;++i){
		int t1,t2,p1,p2;cin>>t1>>t2>>p1>>p2;
		if(p1>p2) points[t1-1] += 3;
		else if(p1 == p2){
			points[t1-1]++;
			points[t2-1]++;
		}else points[t2-1] += 3;
	}
	map<int,set<int> > lst;
	for(int i=0;i<n;++i){
		lst[points[i]].insert(i+1);
	}
	sort(points.begin(), points.end(), greater<int>());
	int bf = -1;
	vector<int> rank(n);
	int rk=1;
	for(int i=0;i<n;++i){
		int val = points[i];
		set<int>::iterator it = lst[val].begin();
		if(bf == val){
			bf = val;
			continue;
		}
		bf = val;
		for(;it!=lst[val].end();++it){
			rank[*it-1] = rk;
		}
		rk+=lst[val].size();
	}
	for(int i=0;i<n;++i) cout<<rank[i]<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;

int main(){
  int n;
  cin>>n;
  vector<pii>team;
  for(int j=0;j<n;j++) team.push_back(pii(0,j));
  for(int i=0;i<(n*(n-1))/2;i++){
    int ta,tb,sa,sb;
    cin>>ta>>tb>>sa>>sb;
    if(sa>sb){
      team[--ta].first+=3;
    }else if(sa<sb){
      team[--tb].first+=3;
    }else{
      team[--ta].first++;
      team[--tb].first++;
    }
  }
  sort(team.begin(),team.end());

  int ans[n];
  for(int i=0;i<team.size();i++){
    int cnt=0;
    if(team[i].first==team[i+1].first)cnt++;
    ans[team[i].second]=n-i-cnt;
  }
  for(int i=0;i<n;i++){
    cout << ans[i] << endl; 
  }
 return 0;
}

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

int main() {
	int n ,team1 ,team2 ,score1 ,score2 ,a[100]={} ,save[100]={};
	cin>>n;
	for(int i=0;i<(n*(n-1)/2);i++){
		team1=0;
		team2=0;
		score1=0;
		score2=0;
		cin>>team1>>team2>>score1>>score2;
		if(score1>score2){
			a[team1]+=3;
		}
		else if(score1<score2){
			a[team2]+=3;
		}
		else if(score1==score2){
			a[team1]++;
			a[team2]++;
		}
	}
	for(int i=1;i<=n;i++){
		save[i]=a[i];
	}
	sort(a,a+n+1);
	for(int i=1;i<=n;i++){
		for(int l=1;l<=n;l++){
				if(a[l]==save[i]){
				if(a[l]==a[l+1]){

				}
				else{
						cout<<n-l+1<<endl;
						break;
				}	
			}
		}
	}

return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int team[100];
    for(int i=0;i<100;i++)team[i]=0;
    int n;
    cin>>n;
    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-1]+=3;
        else if(c=d){
            team[a-1]++;
            team[b-1]++;
        }
    }
    for(int i=0;i<n;i++)cout<<team[i]<<endl;
    return 0;
}