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>
using namespace std;
#include<algorithm>
int main()
{
	int sta[101]={},stb[101]={},ju[101]={};
	int A,B,C,D,i,n,m,j;
	cin>>n;
	for(i=1;i<=n;i++){
		sta[i]=i;
	}
	m=n*(n-1)/2;
	for(i=0;i<m;i++){
		cin>>A>>B>>C>>D;
		if(C>D){
			stb[A]+=3;
		}
		else if(C<D){
			stb[B]+=3;
		}
		else{
			stb[B]++;
			stb[A]++;
		}
	}
	for(i=1;i<=n-1;i++){
		for(j=i+1;j<=n;j++){
			if(stb[i]<stb[j]){
				m=stb[i];
				stb[i]=stb[j];
				stb[j]=m;
				m=sta[i];
				sta[i]=sta[j];
				sta[j]=m;       

			}
		}
	}
	for(i=1;i<=n;i++){
			if(stb[i]==stb[i-1]){
				ju[sta[i]]=ju[sta[i-1]];
			}
			else {
				ju[sta[i]]=i;
			}
	}
	for(i=1;i<=n;i++){
		cout<<ju[i]<<endl;
	}
	return 0;
}

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

int main() {
	int N, A, B, C, D;
	cin >> N;
	vector<tuple<int, int, int>> a(N);
	for (int i = 0; i < N; ++i) get<0>(a[i]) = 1 + i;
	for (int i = 0; i < (N - 1) * N / 2; ++i) {
		cin >> A >> B >> C >> D;
		if (C < D) get<1>(a[B - 1]) += 3;
		else if (C == D) {
			++get<1>(a[A - 1]);
			++get<1>(a[B - 1]);
		}
		else get<1>(a[A - 1]) += 3;
	}
	sort(a.begin(), a.end(), [](tuple<int, int, int>& a, tuple<int, int, int>& b) { return get<1>(a) > get<1>(b); });	
	for (int i = 0; i < N; ++i) get<2>(a[i]) = 1 + i;
	for (int i = 1; i < N; ++i) {
		if (get<1>(a[i - 1]) == get<1>(a[i])) get<2>(a[i]) = get<2>(a[i - 1]);
	}
	sort(a.begin(), a.end());
	for (tuple<int, int, int>& i : a) cout << get<2>(i) << endl;
}

C++: #include <iostream>
#include <vector>
#include <map>
#include <functional>
using namespace std;
int main()
{
  int N;
  cin >> N;
  vector<int> pt(N,0);
  for(int i=0; i<N*(N-1)/2; i++){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    if(c > d) pt[a-1] += 3;
    else if(c < d) pt[b-1] += 3;
    else{
      pt[a-1] += 1;
      pt[b-1] += 1;
    }
  }
  map<int,vector<int>,greater<int> > sort;
  for(int i=0; i<N; i++)
    sort[pt[i]].push_back(i);
  vector<int> rank(N,0);
  int count = 1;
  map<int,vector<int> >::iterator p;
  for(p = sort.begin(); p != sort.end(); p++){
    vector<int> vt = (*p).second;
    int ct = 0;
    for(int i=0; i<vt.size(); i++){
      rank[vt[i]] = count;
      ct++;
    }
    count += ct;
  }
  for(int i=0; i<rank.size(); i++) cout << rank[i] << endl;
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void){
	int N=0,team[101]={0},a=0,b=0,c=0,d=0,cnt=1,e=0;
	cin>>N;
	e=(N*N-N)/2;
	for(int i=1;i<=e;i++)
	{
		cin>>a>>b>>c>>d;
		if(c>d){team[a]=team[a]+3;}
		else if(c<d){team[b]=team[b]+3;}
		else{team[a]++;team[b]++;}
	}
	for(int i=1;i<=N;i++){
		for(int j=1;j<=N;j++){
			if(team[i]<team[j])
			{
				cnt++;
			}
		}
		cout<<cnt<<endl;
		cnt=1;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int INF=-5;
int main(){
	int n,ten[107]={0};
	cin>>n;
	for(int i=0;i<n*(n-1)/2;i++){
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		if(c>d)ten[a]+=3;
		else if(c<d)ten[b]+=3;
		else ten[a]++,ten[b]++;
	}
	//for(int i=1;i<=n;i++)cout<<ten[i];
	int same=0;vector<int>s;int kekka[107]={0};
	int tenpu=0;
	for(int i=1;i<=n;i++){
		if(kekka[i]!=0)continue;
		int tmp=INF,tmpj=INF;//暫定一位
		for(int j=1;j<=n;j++){
			if(ten[j]==INF)continue;
			if(tmp<ten[j]){
			tmp=ten[j];
			tmpj=j;
			//kekka[j]=i;
			}
		}
		kekka[tmpj]=i;
		ten[tmpj]=INF;
		//この時点で、tmpは残っている中で一位
		for(int j=1;j<=n;j++){
			if(ten[j]==INF)continue;
			if(tmpj!=j&&tmp==ten[j]){//暫定一位とは別の同じお特典があったら
				kekka[j]=i;
				ten[j]=INF;
			}
		}
		//cout<<kekka[1]<<kekka[2]<<kekka[3]<<kekka[4]<<endl;
	}
	for(int i=1;i<=n;i++)cout<<kekka[i]<<endl;
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include <cstdint>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;


int n, a, b, c, d;
int t[101];

int main() {

	cin >> n;
	rep(i, n * (n - 1) / 2) {
		cin >> a >> b >> c >> d;
		if (c > d) {
			t[a] += 3;
		}
		else if (d > c) {
			t[b] += 3;
		}
		else {
			t[a]++;
			t[b]++;
		}
	}
	REP(i, 1, n + 1) {
		int cnt = 1;
		REP(j, 1, n + 1) {
			if (i != j) {
				if (t[i] < t[j])cnt++;
			}
		}
		cout << cnt << endl;
	}
	

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int N,n[110],cnt=1,A,B,C,D;
	cin>>N;
	for(int i=0;i<N*(N-1)/2;i++){
		cin>>A>>B>>C>>D;
		if(C==D){
			n[A]+=1;
			n[B]+=1;
		}
		if(C>D){
			n[A]+=3;
		}
		if(D>C){
			n[B]+=3;
		}
	}
	for(int i=1;i<=N;i++){
		cnt=1;
		for(int j=1;j<=N;j++){
			if(i!=j && n[i]<n[j]){
				cnt++;
			}
		}
		cout<<cnt<<endl;
	}
	return 0;
}

C++: //Soccer
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int N, a, b, c, d;
    vector<int> v;
    cin >> N;
    int S[N + 1];
    for(int i = 1; i < N + 1; i++) S[i] = 0;
    for(int i = 0; i < (N * (N - 1) / 2); i++) {
        cin >> a >> b >> c >> d;
        if(c > d) S[a] += 3;
        else if(c < d) S[b] += 3;
        else {S[a]++; S[b]++;}
    }
    for(int i = 1; i < N + 1; i++) {
        v.push_back(S[i]);
    }

    sort(v.begin(), v.end());

    for(int i = 1; i < N + 1; i++) {
        cout << 1 + int(distance(upper_bound(v.begin(), v.end(), S[i]), v.end())) << endl;
    }
}

C++: //============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
int A[5001],B[5001],C[5001],D[5001];
int N,M;
int S[101]={};
int main() {
	cin>>N;
	for(int i=0;i<(N*(N-1)/2);i++){
		cin>>A[i]>>B[i]>>C[i]>>D[i];
		if(C[i]>D[i])S[A[i]]+=3;
		if(C[i]<D[i])S[B[i]]+=3;
		if(C[i]==D[i])S[A[i]]+=1,S[B[i]]+=1;
	}

	int T=0;
	for(int i=1;i<N+1;i++){
		T=1;
		for(int j=1;j<N+1;j++){
			if(S[i]<S[j])T+=1;
		}
		cout<<T<<endl;

	}
	return 0;
}