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(void)
{
	int a,s,d,f,g,h[101],i,j,z[101];
	scanf("%d",&a);
	for(i=1;i<=a;i++){
		z[i]=1;
		//printf("%d\n",z[4]);
	}
//	printf("%d\n",z[4]);
	for(i=1;i<=a*(a-1)/2;i++){
		h[i]=0;
	}
	for(i=1;i<=a*(a-1)/2;i++){
		scanf("%d %d %d %d",&s,&d,&f,&g);
		if(f<g){
			h[d]=h[d]+3;
		}
		else if(f>g){
			h[s]=h[s]+3;
		}
		else if(f==g){
			h[d]++;
			h[s]++;
		}
	}
	for(i=1;i<=a;i++){
		for(j=1;j<=a;j++){
			if(h[i]<h[j]){
				z[i]=z[i]+1;
			//	printf("z[%d]=%d\n",i,z[i]);
			}

		}
	}
	for(i=1;i<=a;i++){
		printf("%d\n",z[i]);
	}
	return 0;
}

C++: #include<stdio.h>

int main(void){
	int n, i, j, team[100], score[100], a, b, c, d;
	scanf("%d", &n);
	for (i = 0; i<n; i++){
		team[i] = 0;
	}
	for (i = 0; i<n*(n - 1) / 2; i++){
		scanf("%d%d%d%d", &a, &b, &c, &d);
		if (c>d){
			team[a - 1] += 3;
		}
		else if (c<d){
			team[b - 1] += 3;
		}
		else{
			team[a - 1]++;
			team[b - 1]++;
		}
	}
	for (i = 0; i<n; i++){
		score[i] = 1;
		for (j = 0; j<n; j++){
			if (team[i]<team[j]){
				score[i]++;
			}
		}
	}
	for (i = 0; i<n; i++){
		printf("%d\n", score[i]);
	}
	return 0;
}

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

int main()
{
    int n, a, b, c, d;

    cin >> n;

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

    int p1[n];
    for( int i = 0; i < n; i++ )
    {
        int sum = 0;
        for( int j = 0; j < n; j++ )
        {
            if( i != j )
                sum += m[i][j];
        }
        p1[i] = sum;
    }

    for( int i = 0; i < n; i++ )
    {
        int sum = 1;
        for( int j = 0; j < n; j++ )
        {
            if( p1[i] < p1[j] && i != j )
                sum++;
        }
        cout << sum << endl;
    }

    return 0;
}

C++: #include<iostream>

using namespace std;

int main(){

    int N;
    int A,B,C,D;
    int sc[101]={0};
    int rank[101];
    int n;
    int max,mi;
    int c;

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

    n=0;
    while(n<N){
        max=sc[1],mi=1;
        for(int i=2;i<=N;i++){
            if(sc[i]>max){
                max=sc[i];
                mi=i;
            }
        }
        c=0;
        for(int i=1;i<=N;i++){
            if(sc[i]==max){
                sc[i]=-1;
                c++;
                rank[i]=n+1;
            }
        }
        n+=c;
    }

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

}

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

int main(){
    int n, a, b, as, bs;
    cin >> n;
    vector<int> po(n,0);
    vector<int> ran(n,0);
    for(int i = 0;i<n*(n-1)/2;i++){
        cin >> a >> b >> as >> bs;
        if(as == bs){
            po[a-1]++;
            po[b-1]++;
        }
        else if(as>bs){
            po[a-1]+=3;
        }
        else{
            po[b-1]+=3;
        }
    }
    bool flag;
    int j = 1, temp=0;
    for(int i = *max_element(po.begin(), po.end());i>=0;i--){
        flag = false;
        temp = 0;
        for(int k = 0;k<n;k++){
            if(po[k] == i){
                ran[k] = j;
                flag = true;
                temp++;
            }
        }
        if(flag){
            j += temp;
        }
    }
    for(int i = 0;i<n;i++){
        cout << ran[i] << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
struct S{
	int a;
	int b;
	bool operator > (const S& s)const
	{
		if(a < s.a){
			return true;
		}
		return false;
	}
	bool operator > (const S& s)const
	{
		if(a > s.a){
			return true;
		}
		return false;
	}
};
#include<aigorithm>
int main()
{
	S st[101]={};
	int A,B,C,D,i,n;
	cin>>n;
	for(i=1;i<=n;i++){
		st[i].a=i;
	}
	m=n(n-1)/2;
	for(i=0;i<m;i++){
		cin>>A>>B>>C>>D;
		if(A>B){
			st.b[C]+=3;
		}
		else if(A<B){
			st.b[D]+=3;
		}
		else{
			st.b[D]++;
			st.b[C]++;
		}
	}
	sort(st.b,n);
	cout<<st[i].a
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}
struct data{
  ll id,s;
  bool operator<(const data& d){
    return id < d.id;
  }
  bool operator>(const data& d){
    return s > d.s;
  }
};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,a,b,c,d;
  cin >> n;
  vector<data> v(n);
  rep(i,n){
    v[i].id = i+1;
  }
  rep(i,n * (n-1)/2){
    cin >> a >> b >> c >> d;
    --a,--b;
    if(c > d){
      v[a].s += 3;
    }
    else if(c == d){
      v[a].s++;
      v[b].s++;
    }
    else{
      v[b].s += 3;
    }
  }
  sort(all(v),[](const data& d,const data& d2){return d.s > d2.s;});
  ll k = inf;
  ll cnt = 1;
  rep(i,n){
    if(k != v[i].s){
      k = v[i].s;
      v[i].s = i+1;
      cnt = i+1;
    }
    else if(k == v[i].s){
      v[i].s = cnt;
    }
  }
  sort(all(v));
  rep(i,n){
    cout << v[i].s<<endl;
  }
  return 0;
}