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<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){
		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<stdio.h>
#include<algorithm>
using namespace std;
//NO SPECIFIED SPORTS!!!!
int p[100];
int q[100];
int main(){
	int a;
	scanf("%d",&a);
	for(int i=0;i<a*(a-1)/2;i++){
		int b,c,d,e;
		scanf("%d%d%d%d",&b,&c,&d,&e);
		b--;
		c--;
		if(d==e){
			p[b]--;
			p[c]--;
		}
		if(d<e){
			p[c]-=3;
		}
		if(e<d){
			p[b]-=3;
		}
	}
	for(int i=0;i<a;i++)q[i]=p[i];
	std::sort(p,p+a);
	for(int i=0;i<a;i++){
		printf("%d\n",lower_bound(p,p+a,q[i])-p+1);
	}
}

C++: #include <iostream>
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);
	int n;
	int table[100]={0};
	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){
			table[a]++;
			table[b]++;
		}else if(c>d){
			table[a]+=3;
		}else{
			table[b]+=3;
		}
	}
	for(int i = 0 ; i < n ; i++){
		int weakness = 0;
		for(int j = 0 ; j < n ; j++){
			if(i != j && table[j] > table[i]){
				weakness++;
			}
		}
		cout << weakness + 1 << endl;
	}
	
}

C++: #include <stdio.h>
#include <algorithm>
#include <utility>
using namespace std;
typedef pair<int,int> pi;
#define F first
#define S second
const int N=1e2+10;
bool cmp(pi a,pi b){
    return a.F>b.F;
    
}
int main(){
    int n,a,b,c,d,tot,ans[N],now=1;
    pi val[N];
    scanf("%d",&n);
    for(int i=1;i<=n;i++)val[i]={0,i};
    tot=(n*(n-1))/2;
    while(tot--){
        scanf("%d%d%d%d",&a,&b,&c,&d);
        if(c==d){
            val[a].F++;
            val[b].F++;
        }
        else if(c>d)val[a].F+=3;
        else val[b].F+=3;
    }
    sort(val+1,val+1+n,cmp);
    ans[val[1].S]=now;
    for(int i=2;i<=n;i++){
        if(val[i].F!=val[i-1].F)now=i;
        ans[val[i].S]=now;
    }
    for(int i=1;i<=n;i++)printf("%d\n",ans[i]);
}

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

int main(){
	int n;
	scanf("%d", &n);
	vector<int> point(n, 0);
	
	for (int i=0; i<n*(n-1)/2; i++){
		int a, b, c, d;
		scanf("%d %d %d %d", &a, &b, &c, &d);
		if (c > d){
			point[a-1] += 3;
		}else if (c == d){
			point[a-1]++;
			point[b-1]++;
		}else{
			point[b-1] += 3;
		}
	}

	for (int i=0; i<point.size(); i++){
		int rank = 1;
		for (int j=0; j<point.size(); j++){
			if ( point[i] < point[j] ){
				rank++;
			}
		}
		printf("%d\n", rank);
	}

	return 0;
}

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

int main(){
  int n;
  while(cin >> n){
    vector<int> v(n,0),ans(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) v[a] += 3;
      else if(c < d) v[b] += 3;
      else{
	v[a]++;
	v[b]++;
      }
    }

    int dr = -1, dr_c=0;
    for(int i=0;i<n;i++){
      int a = -1, b;
      for(int j=0;j<n;j++){
	if(a < v[j]){
	  a = v[j];
	  b = j;
	}
      }
      if(dr == v[b]) dr_c++;
      else dr_c = 0;
      ans[b] = i + 1 - dr_c;
      dr = v[b];
      v[b] = -1;
    }

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

  }
  return 0;
}

C++: // 2013/11/25 Tazoe

#include <iostream>
using namespace std;

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

	int P[101];
	for(int i=1; i<=N; i++){
		P[i] = 0;
	}

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

		if(C>D){
			P[A] += 3;
		}
		else if(C<D){
			P[B] += 3;
		}
		else{
			P[A] += 1;
			P[B] += 1;
		}
	}

	for(int i=1; i<=N; i++){
		int cnt = 0;

		for(int j=1; j<=N; j++){
			if(P[i]<P[j]){
				cnt++;
			}
		}

		cout << cnt+1 << endl;
	}

	return 0;
}

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

int main() {

	//ifstream cin("INPUT.txt");
	//ofstream cout("OUTPUT.txt");

	int team, game, i, j;
	int point[100] = {0};
	int a, b, c, d;

	cin >> team;

	game = team * ( team - 1 ) / 2;

	for(i = 0; i < game; i++) {
		cin >> a >> b >> c >> d;
		if(c < d) {
			point[b-1] += 3;
		} else if(c > d) {
			point[a-1] += 3;
		} else if(c == d) {
			point[a-1] += 1;
			point[b-1] += 1;
		}
	}

	int rank[100] = {0};
	for(i = 0; i < team; i++) {
		rank[i] = point[i];
	}

	sort(rank, rank+100, greater<int>());

	for(i = 0; i < team; i++) {
		for(j = 0; j < team; j++) {
			if(point[i] == rank[j]) {
				cout << j + 1 << endl;
				break;
			}
		}
	}

	return 0;

}