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 <bits/stdc++.h>
using namespace std;
typedef long long ll;

struct Data {
  int p, id;
  Data(int p, int id) : p(p), id(id){}
  bool operator< (const Data& d) const {
    return p > d.p;
  } 
};

int main() {
    int N;
    cin >> N;
    int l = N * (N - 1) / 2;
    int A[l], B[l], C[l], D[l];
    for (int i = 0; i < l; i++) {
        cin >> A[i] >> B[i] >> C[i] >> D[i];
        A[i]--;
        B[i]--;
    }
    vector<Data> d;
    for (int i = 0; i < N; i++) {
        d.push_back(Data(0, i));
    }    
    for (int i = 0; i < l; i++) {
        if (C[i] == D[i]) {
            d[A[i]].p += 1;
            d[B[i]].p += 1;
        } else if (C[i] > D[i]) {
            d[A[i]].p += 3;
        } else {
            d[B[i]].p += 3;
        }
    }
    sort(d.begin(), d.end());
    int rank[N];
    int k = 1;
    rank[d[0].id] = 1;
    for (int i = 1; i < N; i++) {
        if (d[i].p == d[i - 1].p) {
            rank[d[i].id] = rank[d[i - 1].id];
            k++;
        } else {
            rank[d[i].id] = rank[d[i - 1].id] + k;
            k = 1;
        }
    }
    for (int i : rank) {
        cout << i << "\n";
    }
    return 0;
}

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

	int A[1000];
	int B[1000]; 


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

	sort(A,A+1000);
	reverse(A,A+1000);

	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++: // 2012/11/19 Tazoe

#include <iostream>
using namespace std;

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

	int P[100];
	for(int i=0; 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-1] += 3;
		}
		else if(C<D){
			P[B-1] += 3;
		}
		else{
			P[A-1] += 1;
			P[B-1] += 1;
		}
	}

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

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

	for(int i=0; i<N; i++){
		cout << R[i] << '\n';
	}

	return 0;
}

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

int main()
{
    int n;
    cin >> n;
    int a[n]={};
    for(int i=0;i<n*(n-1)/2;i++){
        int t1,t2,s1,s2;
        cin >> t1 >> t2 >> s1 >> s2;
        if(s1>s2) a[t1-1]+=3;
        else if(s1<s2) a[t2-1]+=3;
        else {
            a[t1-1]++;
            a[t2-1]++;
        }
    }
    int b[n];
    for(int i=0;i<n;i++) b[i]=a[i];
    sort(a,a+n);
    for(int i=0;i<n;i++){
        for(int j=n;j>=0;j--){
            if(b[i]==a[j]){
                b[i]=n-j;
                break;
            }
        }
    }
    for(int i=0;i<n;i++) cout << b[i] << endl;
    return 0;
}

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

struct team {
	int nb, pt, pc;
};

bool nbsmaller(team lhs, team rhs) {
	return lhs.nb < rhs.nb;
}

bool ptgreater(team lhs, team rhs) {
	return lhs.pt > rhs.pt;
}

int main()
{
	int n;

	cin >> n;

	vector<team> w(n);
	int m = n * (n - 1) / 2;

	for (int i = 0; i < n; i++) {
		w[i].nb = i + 1;
		w[i].pt = 0;
	}

	for (int i = 0; i < m; i++) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;

		if (c > d)
			w[a - 1].pt += 3;
		else if (c < d)
			w[b - 1].pt += 3;
		else {
			w[a - 1].pt++;
			w[b - 1].pt++;
		}
	}

	sort(w.begin(), w.end(), ptgreater);

	int j = 1, k = 1;
	for (int i = 0; i < n; i++) {
		w[i].pc = j;
		if (i < n - 1 && w[i].pt > w[i + 1].pt) {
			j += k;
			k = 1;
		}
		else
			k++;
	}

	sort(w.begin(), w.end(), nbsmaller);

	for (int i = 0; i < n; i++)
		cout << w[i].pc << endl;

	return 0;
}

C++: #include <stdio.h>
int main(){

  int n,team[100]={0},num[100],rank[100],ta,tb,sa,sb,i,j;
  int blank;
  
  scanf("%d",&n);

  for(i = 0; i < (n*n-n)/2; i++){

    scanf("%d %d %d %d",&ta,&tb,&sa,&sb);

    if(sa > sb) team[ta-1] += 3; 
    else if(sa < sb) team[tb-1] += 3;
    else{

      team[ta-1]++;
      team[tb-1]++;

    }

  }

  for(i = 0; i < n; i++) num[i]=i;

  for(i = 0; i < n-1; i++){

    for(j = 0; j < n-1; j++){

      if(team[j] < team[j+1]){

        blank=team[j];
        team[j]=team[j+1];
        team[j+1]=blank;

        blank=num[j];
        num[j]=num[j+1];
        num[j+1]=blank;
        
      }

    }

  }

  // for(i = 0; i < n; i++) printf("%d\n",num[i]);

  rank[0]=1;
  for(i = 1; i < n; i++){

    rank[i]=i+1;
    if(team[i] == team[i-1]) rank[i]=rank[i-1];

  }

  //for(i = 0; i < n; i++) printf("%d\n",rank[i]);
  
  for(i = 0; i < n-1; i++){

    for(j = 0; j < n-1; j++){

      if(num[j] > num[j+1]){

        blank=num[j];
        num[j]=num[j+1];
        num[j+1]=blank;
#include <stdio.h>
int main(){

  int n,team[100]={0},num[100],rank[100],ta,tb,sa,sb,i,j;
  int blank;
  
  scanf("%d",&n);

  for(i = 0; i < (n*n-n)/2; i++){

    scanf("%d %d %d %d",&ta,&tb,&sa,&sb);

    if(sa > sb) team[ta-1] += 3; 
    else if(sa < sb) team[tb-1] += 3;
    else{

      team[ta-1]++;
      team[tb-1]++;

    }

  }

  for(i = 0; i < n; i++) num[i]=i;

  for(i = 0; i < n-1; i++){

    for(j = 0; j < n-1; j++){

      if(team[j] < team[j+1]){

        blank=team[j];
        team[j]=team[j+1];
        team[j+1]=blank;

        blank=num[j];
        num[j]=num[j+1];
        num[j+1]=blank;
        
      }

    }

  }

  // for(i = 0; i < n; i++) printf("%d\n",num[i]);

  rank[0]=1;
  for(i = 1; i < n; i++){

    rank[i]=i+1;
    if(team[i] == team[i-1]) rank[i]=rank[i-1];

  }

  //for(i = 0; i < n; i++) printf("%d\n",rank[i]);
  
  for(i = 0; i < n-1; i++){

    for(j = 0; j < n-1; j++){

      if(num[j] > num[j+1]){

        blank=num[j];
        num[j]=num[j+1];
        num[j+1]=blank;

        blank=rank[j];
        rank[j]=rank[j+1];
        rank[j+1]=blank;
        
      }

    }

  }
  //for(i = 0; i < n; i++) printf("%d\n",num[i]);
  for(i = 0; i < n; i++) printf("%d\n",rank[i]);

  return 0;

}
  
      

      

        blank=rank[j];
        rank[j]=rank[j+1];
        rank[j+1]=blank;
        
      }

    }

  }
  //for(i = 0; i < n; i++) printf("%d\n",num[i]);
  for(i = 0; i < n; i++) printf("%d\n",rank[i]);

  return 0;

}