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,a,b,c,d;
    cin >> n;

	int A[1000];
	int B[1000]; 


	for (int i=0; i<n; i++){
		A[i] = 0;
		B[i] = 0;
	}


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

	sort(A,A+n);
	reverse(A,A+n);

	int x = 0;

	for(int i=0; i<n; i++){
		for(int j=0; j<n; j++){
			x++;
			if(B[i] == A[j]){
				cout << x << endl;
				x = 0;
				break;
			}
			
		}
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(void){
	int a, b=0, c, d, e[100]={0}, g[100]={0}, i, j, f,k;
	cin >> a;
	b=a*(a-1)/2;
	for(i=1;i<=b;i++){
		cin >> c >> d >> f >> k;
		if(f > k){
			g[c] = g[c] + 3;
		}
		else if(k > f){
			g[d] = g[d] + 3;
		}
		else{
			g[c]++;
			g[d]++;
		}
	}
	for(i=1;i<=a;i++){
		for(j=1;j<=a;j++){
			if(g[i]<g[j]){
				 e[i]++;
			}
		}
	}
	for(i=1;i<=a;i++){
	e[i]++;
	cout << e[i] << endl;
	}
}

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

struct P{
	int team;
	int win;
	int rank;
	static bool more(const P& left,const P& right){ return left.win > right.win; }
};

int main()
{
	int n,t1,t2,p1,p2;
	P data [512];
	cin >> n;
	for(int i=0;i<n;i++){
		data[i].team = i+1;
		data[i].win = 0;
	}
	for(int i=0;i<n*(n-1)/2;i++){
		cin >> t1 >> t2 >> p1 >> p2;
		if(p1 > p2) data[t1-1].win += 3;
		else if(p1 < p2) data[t2-1].win += 3;
		else if(p1 == p2){
			data[t1-1].win++;
			data[t2-1].win++;
		}
	}
    sort(data,data + n,P::more);
	data[0].rank = 1;
	for(int i=1;i<n;i++){
		if(data[i-1].win == data[i].win) data[i].rank= data[i-1].rank;
		else data[i].rank = i+1;
	}
	for(int j=0;j<n;j++){
		for(int i=0;i<n;i++){
			if(data[i].team == j+1){
				cout << data[i].rank << endl;
				break;
			}
		}
	}
}

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

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

    for(int i=1; i<=n; i++){
        cout << "  " << N[i] << endl;
    }
    int s;
    for(int i=1; i<=n; i++){
        s=1;
        for(int j=1; j<=n; j++){
            if(N[i]<N[j]){
                s++;
            }
            C[i] = s;
        }
    }
    for(int i=1; i<=n; i++){
        cout << C[i] << endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int point[101];
vector<int> pointed;
int main() {
	int N;
	cin >> N;
	for(int i=0;i<N*(N-1)/2;i++){
		int a,b,c,d;
		cin >> a >> b >> c >> d;
		if(c==d){
		point[a]++;
		point[b]++;
		}
		if(c>d){
			point[a]+=3;
		}
		if(c<d){
			point[b]+=3;
		}
	}
	for(int i=0;i<N;i++){
		pointed.push_back(point[i+1]);
///		cout << point[N] << endl;
	}
	sort(pointed.begin(),pointed.end());
	
	for(int i=1;i<=N;i++){
		for(int j=N-1;j>=0;j--){
			if(pointed[j]==point[i]){
				cout << N-j << endl;
			break;
			}
		}
	}
	
	// your code goes here
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int main(void) {
  int N;
  int T1, T2, P1, P2;
  int cnt[100]={0};
  int R = 0;
  int j = 0;
  while(cin >> N) {
    memset(cnt, 0, sizeof(cnt));
    for(int i = 0 ; i < N*(N-1)/2 ; i++) {
      cin >> T1 >> T2 >> P1 >> P2;
      if(P1 > P2) cnt[T1] += 3; 
      else if(P1 < P2) cnt[T2] += 3;
      else if(P1 == P2) { cnt[T1]++; cnt[T2]++; }	
    }
    /*for(int i = 1 ; i <= N ; i++) {
      cout << cnt[i] << ' ';
    }
    cout << endl;*/
    for(int i = 1 ; i <= N ; i++) {
      for(int j = 1 ; j <= N ; j++) {
	  if(cnt[i] < cnt[j]) R++;
      }
      cout << R+1 << endl;
      R = 0;
    }
    //cout << endl;
  }
  return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

int main()
{
    vector<int> s[301];
    int t[101] = {};
    int ans[101] = {};
    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);
        if (c > d)
            t[a] += 3;
        else if (d > c)
            t[b] += 3;
        else
            t[a] += 1, t[b] += 1;
    }

    for (int i = n; i >= 0; --i) s[t[i]].push_back(i);

    int r = 1;

    for (int i = 300; i >= 0; --i) {
        int cnt = 0;
        while (s[i].size()) {
            ans[s[i].back()] = r;
            s[i].pop_back();
            cnt++;
        }
        r += cnt;
    }

    for (int i = 1; i <= n; ++i) printf("%d\n", ans[i]);
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;
class Team {
public:
	int rank, score, num;
	Team() { rank = 0, score = 0, num = 0; }
};
bool by_score(const Team &a, const Team &b) {
	return a.score > b.score;
}
bool by_num(const Team &a, const Team &b) {
	return a.num < b.num;
}
signed main() {
	int n; cin >> n;
	int battle = n*(n - 1) / 2;
	vector<Team>team(n);
	rep(i, 0, n)team[i].num = i;
	rep(i, 0, battle) {
		int a, b, c, d;
		cin >> a >> b >> c >> d; a--, b--;
		if (c == d) team[a].score++, team[b].score++;
		else if (c < d) team[b].score += 3;
		else team[a].score += 3;
	}
	sort(all(team), by_score);
	team[0].rank = 1;
	int r = 2;
	rep(i, 1, n) {
		if (team[i].score == team[i - 1].score) {
			team[i].rank = team[i - 1].rank;
			r++;
		}
		else team[i].rank = r, r++;
	}
	sort(all(team), by_num);
	rep(i, 0, n)cout << team[i].rank << endl;
	
	return 0;
}