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 <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <algorithm>
#include <functional>

#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,a,b) for(int i=a; i<=b; i++)
#define ll long long int

using namespace std;

int main(void) {
    int n;
    cin >> n;
    vector<pair<int,int> > v(n);
    REP(i,n){
        v[i].second = i;
    }
    int a,b,c,d;
    REP(i,n*(n-1)/2){
        cin >> a >> b >> c >> d;
        a--;b--;
        if (c>d)
            v[a].first+=3;
        else if(c<d)
            v[b].first+=3;
        else{
            v[a].first++;
            v[b].first++;
        }
    }
    sort(v.begin(),v.end(),greater<pair<int,int> >());
    vector<int> rank(n);
    REP(i,n){
        rank[v[i].second] = i+1;
        if (i>0 && v[i].first==v[i-1].first)
            rank[v[i].second] = rank[v[i-1].second];
    }
    REP(i,n){
        cout << rank[i] << endl;
    }
    
    return 0;
}

C++: #include<iostream>
using namespace std ;
int main()
{
	int n ;
	int a ,b ,c ,d ;
	cin >> n ;
	int t[ 101 ] = { 0 } ;
	for( int i = 0 ; i < n * ( n - 1 ) / 2  ; i++ )
	{
		cin >> a >> b >> c >> d ;
		
		if( c == d )
		{
			t[ a ]++ ;
			t[ b ]++ ;
			continue ;
		}
		t[ c > d ? a : b ] += 3 ;
	}
	for( int i = 1 ; i <= n ; i++ )
	{
		int juni = 1 ;
		for( int j = 1 ; j <= n ; j++ )
		{
			if( i == j )
				continue ;
			if( t[ i ] < t[ j ] )
			{
				juni++ ;
			}
		}
		cout << juni << 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.a[i]=i;
	}
	m=n(n-1)/2;
	for(i=0;i<m;i++){
		cin>>A>>B>>C>>D;
		if(C>D){
			st.b[A]+=3;
		}
		else if(C<D){
			st.b[B]+=3;
		}
		else{
			st.b[B]++;
			st.b[A]++;
		}
	}
	sort(st.b,n);
	cout<<st[i].a
	return 0;
}

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

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
typedef vector<int>vint;
typedef pair<int,int>pint;


signed main(){
    int N,p[100]={0},r[100];

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

    vector<pint>vec(N);
    rep(i,N)vec[i]=pint(p[i],i);
    sort(all(vec));reverse(all(vec));

    int tmp=0;
    rep(i,N){
        if(i&&vec[i-1].first!=vec[i].first)tmp=i;
        r[vec[i].second]=tmp;
    }

    rep(i,N)cout<<r[i]+1<<endl;
    return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    int n;
    cin >> n;

    vector<pair<int, int> > x(n);
    for(int i=0; i<n; ++i)
        x[i] = make_pair(0, i);

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

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

    vector<int> ret(n);
    for(int i=0; i<n; ++i){
        if(i > 0 && x[i].first == x[i-1].first){
            ret[x[i].second] = ret[x[i-1].second];
        }else{
            ret[x[i].second] = i+1;
        }
    }

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

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	vector<int> point(n,0);
	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)point[a]+=3;
		else if(c<d)point[b]+=3;
		else point[a]++,point[b]++; 
	}
	vector<pair<int,int>> v;
	for(int i=0;i<n;i++){
		v.push_back({point[i],i});
	}
	sort(v.rbegin(),v.rend());
	for(int i=0;i<n;i++){
		int ii=i;
		int cp=v[i].first;
		while(i<n&&v[i].first==cp){
			point[v[i].second]=ii+1;
			i++;
		}
		i--;
	}
	for(int i=0;i<n;i++){
		cout << point[i] << endl;
	}
}

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

int N, A[5000], B[5000], C[5000], D[5000];
int point[112][2], ans[112];

int main(void) {
	scanf("%d", &N);
	for (int i = 0; i < N*(N - 1) / 2; ++i) { scanf("%d%d%d%d", &A[i], &B[i], &C[i], &D[i]); }

	for (int i = 0; i < N*(N - 1) / 2; ++i) {
		if (C[i] < D[i]) { point[B[i] - 1][0] += 3; }
		if (C[i] > D[i]) { point[A[i] - 1][0] += 3; }
		if (C[i] == D[i]) { point[A[i] - 1][0]++; point[B[i] - 1][0]++; }
	}
	for (int i = 0; i < N; ++i) { point[i][1] = i + 1; }
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			if (point[i][0] > point[j][0]) {
				std::swap(point[i][0], point[j][0]);
				std::swap(point[i][1], point[j][1]);
			}
		}
	}
	for (int i = 0; i < N; ++i) {
		if (point[i][0] == point[i + 1][0]) {
			ans[point[i][1] - 1] = i, ans[point[i + 1][1] - 1] = i; i++;
		}
		else { ans[point[i][1] - 1] = i; }
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (point[i][0] < point[j][0]) {
				ans[i]++;
			}
		}
		printf("%d\n", ans[i] + 1);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
using P=pair<long long,long long>;
typedef unsigned long long ull;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

  
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);  
  
  int n;
  cin >> n;
  vector<int>vec(n);
  rep(i,n*(n-1)/2){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    a--;
    b--;
    if(c>d)vec[a]+=3;
    if(c<d)vec[b]+=3;
    if(c==d){
      vec[a]++;
      vec[b]++;
    }
  }
  vector<int>z(n);
  rep(i,n) z[i]=vec[i];
  sort(z.begin(),z.end(),greater<int>());
  rep(i,n){
    rep(j,z.size()){
      if(vec[i]==z[j]){
        vec[i]=j+1;
        break;
      }
    }
  }
  rep(i,n){
    cout << vec[i] << endl;
  }
}