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 <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }


int n;
int p[200];
int a, b, c, d;

int main() {
    while (cin >> n) {
        memset(p, 0, sizeof(p));
        int m = n * (n-1) / 2;
        for (int i = 0; i < m; ++i) {
            cin >> a >> b >> c >> d;
            --a; --b;
            if (c > d) p[a] += 3;
            else if (c < d) p[b] += 3;
            else p[a] += 1, p[b] += 1;
        }
        vector<int> vec;
        for (int i = 0; i < n; ++i) {vec.PB(p[i]);}
        sort(ALL(vec), greater<int>());
        
        map<int,int> ma;
        for (int i = 0; i < vec.size(); ++i) {
            if (!ma.count(vec[i])) ma[vec[i]] = i+1;
        }
        for (int i = 0; i < n; ++i) cout << ma[p[i]] << endl;
    }
    return 0;
}

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

#define rep(i, n) for(int i=0; i<n; i++)
#define rev(i, n) for(int i=(n)-1; i>=0; i--)

int n;
int d[111];
int rank[111];
int A, B, C, D;

int main(int argc, char *argv[])
{
  cin >> n;
  rep(_, n * (n - 1) / 2){
    cin >> A >> B >> C >> D;
    if(C > D){
      d[A - 1] += 3;
    }
    else if(C < D){
      d[B - 1] += 3;
    }
    else{
      d[A - 1] += 1;
      d[B - 1] += 1;
    }
  }

  vector<int> res[333];
  rep(i, 333) rep(j, n) if(d[j] == i) res[i].push_back(j);

  int p = 1;
  rev(i, 333) if(res[i].size()){
    rep(j, res[i].size()) rank[res[i][j]] = p;
    p += res[i].size();
  }

  rep(i, n) cout << rank[i] << endl;
  
  return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int N;
	cin>>N;
	long long result[N];
	rep(i,N)result[i]=0;
	long long a,b,c,d;
	for(long long i=0;i<N*(N-1)/2;i++){
		cin>>a>>b>>c>>d;
		a--;
		b--;
		if(c>d){
			result[a]+=3;
		}else if(c<d){
			result[b]+=3;
		}else{
			result[a]++;
			result[b]++;
		}
	}
	int team[N];
	rep(i,N)team[i]=i+1;
	/*rep(i,N){
		cout<<team[i]<<" "<<result[i]<<endl;
	}*/
	//cout<<endl;
	for(int i=N;i>=1;i--){
		for(int j=0;j<i-1;j++){
			if(result[j]<result[j+1]){
				int alt=result[j];
				result[j]=result[j+1];
				result[j+1]=alt;
				alt=team[j];
				team[j]=team[j+1];
				team[j+1]=alt;
			}
			//rep(i,N)cout<<team[i]<<" ";
			//cout<<endl;
		}
	}
	int rank[N];
	rep(i,N){
		rank[i]=i+1;
	}
	for(int i=N;i>=1;i--){
		for(int j=0;j<i-1;j++){
			if(team[j]>team[j+1]){
				int alt=result[j];
				result[j]=result[j+1];
				result[j+1]=alt;
				alt=team[j];
				team[j]=team[j+1];
				team[j+1]=alt;
				alt=rank[j];
				rank[j]=rank[j+1];
				rank[j+1]=alt;
			}
		}
	}
	//rep(i,N)cout<<team[i]<<" "<<result[i]<<" "<<rank[i]<<endl;
	//cout<<endl;
	int check[N];
	rep(i,N)check[i]=0;
	int cnt=1;
	rep(i,N){
		rep(j,N){
			if(result[i]==result[j] && i!=j){
				//cout<<"hit "<<i<<" "<<j<<endl;
				check[i]=cnt;
				check[j]=cnt;
				cnt++;
			}
		}
	}
	//rep(i,N)cout<<team[i]<<" "<<result[i]<<" "<<rank[i]<<" "<<check[i]<<endl;
	//cout<<endl;
	rep(i,N){
		if(check[i]){
			rep(j,N){
				if(check[i]==check[j]){
					if(rank[i]>rank[j]){
						rank[i]=rank[j];
					}else{
						rank[j]=rank[i];
					}
				}
			}
		}
	}
	rep(i,N)cout<<rank[i]<<endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n,a,b,c,d;
    cin >> n;

	int A[n];
	int B[n]; //n番目のチームの勝ち点


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

	sort(A.begin(),A.end());
	reverse(A.begin(),A.end());

	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 <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
//#define int long long
using namespace std;
typedef long long ll;

int N;
int a[101], b[101];
int Ai, Bi, Ci, Di;

signed main()
{
	cin >> N;
	rep(i,N*(N-1)/2) {
		cin >> Ai >> Bi >> Ci >> Di;
		if (Ci < Di) {
			a[Bi] += 3;
		} else if (Ci == Di) {
			a[Ai] += 1;
			a[Bi] += 1;
		} else if (Ci > Di) {
			a[Ai] += 3;
		}
	}

	rep(i,101) b[i] = 1;

	for (int i=2; i<=N; i++) {
		for (int j=1; j<=i-1; j++) {
			if (a[j] > a[i]) b[i]++;
			if (a[j] < a[i]) b[j]++;
		}
	}

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