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 <stdio.h>

int main(){

  int score[101]={};
  int stand[101]={};

  int a,b,A,B,n,i,T,I=1,t,j,max=0;

  scanf("%d",&n);

  for(i=1;i<=n*(n-1)/2;i++){

    scanf("%d %d %d %d",&A,&B,&a,&b);

    if(a>b) {
      score[A]+=3;
    }

    else  if(a==b) {
      score[A]+=1,score[B]+=1;
    }

    else  if(a<b) {
      score[B]+=3;
    }

    A=0;
    B=0;
    a=0;
    b=0;
  }

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      if(max<score[j]){
	max=score[j];
	t=j;
      }
      if(max==score[j]){
	T=j;
      }
    }
  
    if(score[T]!=score[t]){
      stand[t]=I;
      score[t]=-1;
      max=0;
      I++;

    }

    else if(score[t]!=-1){
      stand[t]=I;
      stand[T]=I;
      score[t]=-1;
      score[T]=-1;
      max=0;
      I++;
    }
  }
    for(i=1;i<=n;i++){
      printf("%d\n",stand[i]);
    }

    return 0;
}

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

int n;
pair<int, int> teams[100];
int result[100];

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) teams[i].second = i;
	for (int i = 0; i < n * (n - 1) / 2; i++) {
		int a, b, pa, pb;
		cin >> a >> b >> pa >> pb;
		a--; b--;
		if (pa > pb) {
			teams[a].first += 3;
		}
		else if (pb > pa) {
			teams[b].first += 3;
		}
		else {
			teams[a].first++;
			teams[b].first++;
		}
	}
	sort(teams, teams + n, greater<pair<int, int> >());
	int rank = 1;
	result[teams[0].second] = 1;
	for (int i = 1; i < n; i++) {
		if (teams[i].first != teams[i - 1].first) rank = i + 1;
		result[teams[i].second] = rank;
	}
	for (int i = 0; i < n; i++) {
		cout << result[i] << endl;
	}
	return 0;
}

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

using namespace std;

int main()
{
    int n;
    int pair1, pair2, score1, score2;
    int sco[101] = {0};
    int gre = 1;
    int team[101];

    cin >> n;

    for (int i = 0; i < ((n * (n - 1)) / 2); i++) {
        cin >> pair1 >> pair2 >> score1 >> score2;

        if (score1 > score2) {
            sco[pair1] += 3;
        }
        else if (score1 < score2) {
            sco[pair2] += 3;
        }
        else {
            sco[pair1]++;
            sco[pair2]++;
        }
    }
    for (int i = 1; i <= n; i++) {
        int cur = sco[i];
        for (int j = 1; j <= n; j++) {
            if (cur < sco[j]) {
                gre++;
            }
        }
        team[i] = gre;
        gre = 1;
    }

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

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>

#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
	int n; cin >> n;
	vector<int> teams,res;

	rep(i,n) teams.push_back(0);
	res = teams;
	//cout << endl << teams.size() << "teams" << endl;
	
	rep(i,n*(n-1)/2){
		int a,b,c,d;

		cin >> a >> b;
		cin >> c >> d; 
		
		if(c > d) teams[a%(n+1) - 1] += 3;		
		else if(c < d) teams[b%(n+1) - 1] += 3;
		else{
			teams[a%(n+1) - 1] += 1;
			teams[b%(n+1) - 1] += 1;
		}
	}

	//rep(i,teams.size()) cout << "[" << i + 1 << "] " << teams[i] << "score" <<endl;
	
	rep(i,teams.size()){
		rep(j,teams.size()){
			if(teams[i] < teams[j]) res[i] += 1;
		}
	}	
	
	
	rep(i,n) cout << res[i] + 1 << endl;	

	return 0;
	
}

C++: //============================================================================
// Name        : AOL.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
    int n;
    int a;
    int b;
    int c;
    int d;
    int t[101]={};
    cin>>n;
	for(int i=1; i<n*(n-1)/2+1; i++){
		cin>>a>>b>>c>>d;
		if(c<d)t[b]+=3;
		if(c>d)t[a]+=3;
		if(c==d){
			t[a]+=1;
			t[b]+=1;
		}
	}
	for(int j=1; j<n+1; j++){
		int juni=1;
		for(int i=1; i<n+1; i++){
			if(t[j]<t[i])juni+=1;
		}
		cout<<juni<<endl;
	}
}

C++: #include<stdio.h>
#include<stdlib.h>

int main(){
	int n,*t,*rank,x,y;
	int a,b,c,d;
	
	t=(int*)malloc(sizeof(int)*(n+1));
	rank=(int*)malloc(sizeof(int)*(n+1));
	scanf("%d\n",&n);
	for(x=0;x<=n;x++){
		t[x]=0;
		rank[x]=1;
	}
	for(x=0;x<n*(n-1)/2;x++){
		scanf("%d %d %d %d",&a,&b,&c,&d);
		if(c>d)t[a]+=3;
		if(c<d)t[b]+=3;
		if(c==d)t[a]+=1,t[b]+=1;
	}
	for(x=1;x<=n;x++){
		for(y=x+1;y<=n;y++){
			if(t[x]>t[y])rank[y]+=1;
			if(t[x]<t[y])rank[x]+=1;
		}
	}
	for(x=1;x<=n;x++){
		printf("%d\n",rank[x]);
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int score[100];
int ans[100];
vector<int> rnk[301];

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

	for (int i = n - 1; i >= 0; --i) {
		rnk[score[i]].push_back(i);
	}

	int r = 1;

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

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

C++: #include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
    int n,a,b,c,d,s[100]={};
    cin>>n;
    while(cin>>a>>b>>c>>d){
        if(c==d)
            s[--a]++,s[--b]++;
        else if(c>d)
            s[--a]+=3;
        else
            s[--b]+=3;
    }
    for(int i=0;i<n;i++){
        int ans=1;
        for(int j=0;j<n;j++)
            if(s[j]>s[i])
                ans++;
        cout<<ans<<endl;
    }
}

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

int main(){
    int n;
    int score[100]={0},a,b,c,d;

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

    return 0;
}