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>
#include<iostream>
using namespace std;
int main(void){
int n,i,j,a[101],b[101],c[101],d[101],p=0,team[101],team2[101],team3[101],result[101],cnt=0,z;

cin>>n;

for(i=0;i<=n;i++){
	a[i]=0;
	b[i]=0;
	c[i]=0;
	d[i]=0;
	team[i]=0;
	team2[i]=0;
	team3[i]=0;
	result[i]=0;
}

p=n*(n-1)/2;

for(i=1;i<=p;i++){
	cin>>a[i]>>b[i]>>c[i]>>d[i];

	if(c[i]>d[i]){
	team[a[i]]=team[a[i]]+3;
	}

	else if(c[i]<d[i]){
	team[b[i]]=team[b[i]]+3;
	}

	else{
	team[a[i]]=team[a[i]]+1;
	team[b[i]]=team[b[i]]+1;
	}

}

for(i=1;i<=n;i++){
team2[i]=team[i];
}
for(i=1;i<=n;i++){
	if(team[i]<=team[i+1]){
	z=team[i];
	team[i]=team[i+1];
	team[i+1]=z;
	}
}
for(i=1;i<=n;i++){
	for(j=1;j<=n;j++){
		if(team[i]==team2[j]){
		team3[j]=i;
		team2[j]=-1;
		}
	}
}
for(i=1;i<=n;i++){
printf("%d\n",team3[i]);
}

return 0;
}

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

using namespace std;

int main()
{
	int a [3];
	int b [2];
	cin >> a[1] >> a[2] >> a[3] >> b[1] >> b[2];
	int c[6]= {a[1] + b[1], a[1] + b[2], a[2] + b[1], a[2] + b[2], a[3] + b[1], a[3] + b[2]};
	sort(c, c + 6);
	{
	    cout << c[1] - 50 << endl;
	}
	return 0;
}

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

int main(){
  int n,a,b,c,d,t=-1,nr=1,count=0;
  int pt[100]={};
  int rank[100]={};

  cin >> n;

  for (int i=0;i<n*(n-1)/2;i++){
    cin >> a >> b >> c >> d;
    if (c > d) pt[a-1]+=3;
    else if (c < d) pt[b-1]+=3;
    else {
      pt[a-1]++;
      pt[b-1]++;
    }
  }
  while (nr<=n){
    for (int i=0;i<n;i++){
      if (t<pt[i])t=pt[i];
    }
    for (int i=0;i<n;i++){
      if (t==pt[i]){
	rank[i]=nr;
	pt[i]=-1;
	count ++;
      }
    }
    nr+=count;
    count =0;
    t=-1;
  }

  for (int i=0;i<n;i++) cout << rank[i] <<endl;

  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;
  int sc[N]={};
  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 <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;
        }
    }
    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<cstdio>
#include<algorithm>
 
using namespace std;
 
int main(){
    int team,score[10000]={0},r;
    cin >>team;
    r=team*(team-1)/2;
    for(int i=0;i<r;i++){
        int a,b,c,d;
        cin >>a>>b>>c>>d;
        if(c>d)score[a]+=3;
        else if(c<d)score[b]+=3;
        else {
            score[a]++;
            score[b]++;
        }
    }
    int hi[10000]={0};
    for(int i=0;i<r;i++){
        hi[i]=score[i];
    }
    sort(hi+1, hi+r, greater<int>());
    for(int i=1;i<=team;i++){
        for(int j=0;j<r;j++){
            if(score[i]==hi[j]){
                cout<<j<<endl;
                score[i]=-1;
            }
        }
    }
    return 0;
}

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

typedef pair<int,int> P;

int main(){
  int n;

  while(cin >> n){
    P t[n + 2];

    for(int i = 0; i < n; i++){
      t[i] = P(0, i);
    }

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

    sort(t, t + n, greater<P>());

    int rank[n];

    for(int i = 0; i < n; i++){
      if(i != 0 && t[i].first == t[i - 1].first){
        rank[t[i].second] = rank[t[i - 1].second];
      }
      else{
        rank[t[i].second] = i + 1;
      }
    }

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int team;
    cin >> team;
    vector<int>point(team,0);
    for(int i = 0;i < team*(team-1)/2;i++){
        int home,away;
        int hpo,apo;
        cin >> home;
        cin >> away;
        cin >> hpo;
        cin >> apo;
        if(hpo > apo){
            point[home-1]+=3;
        }
        else if(hpo < apo){
            point[away-1]+=3;
        }
        else{
            point[home-1]++;
            point[away-1]++;
        }
    }
    vector<int>runk;
    runk = point;
    sort(runk.begin(),runk.end());
    for(int i = 0;i < team;i++){
        int R;
        for(int j = team-1;j >= 0;j--){
            if(point[i] == runk[j]){
                R = team-j;
                break;
            }
        }
        cout << R << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const ll INF=1ll<<50;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

int n;
vi ans;
vp sco;

int main(){
	cin>>n;
	ans=vi(n);
	sco=vp(n);
	for(int i=0;i<n;i++) sco[i].second=i;
	for(int i=0;i<n*(n-1)/2;i++){
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		if(c>d) sco[a-1].first-=3;
		else if(c<d) sco[b-1].first-=3;
		else{
			sco[a-1].first--;
			sco[b-1].first--;
		}
	}
	sort(sco.begin(),sco.end());
	for(int i=0;i<n;i++){
		if(i&&sco[i].first==sco[i-1].first) ans[sco[i].second]=ans[sco[i-1].second];
		else ans[sco[i].second]=i;
	}
	for(int i=0;i<n;i++) cout<<ans[i]+1<<endl;
}