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;
int n,game,a,b,c,d;
typedef struct{
	int rank;
	int score;
}Team;
Team team[100];
int main(){
	cin >> n;
	game =n*(n-1)/2;
	for(int i=0;i<game;i++){
		cin >> a >>b >> c >>d;
		if(c>d){
			team[a].score+=3;
			team[b].score+=0;
		}else if(c==d){
			team[a].score+=1;
			team[b].score+=1;
		}else{
			team[a].score+=0;
			team[b].score+=3;
		}
	}
	for(int i=1;i<=n;i++){
		team[i].rank=1;
		for(int j=1;j<=n;j++){
			if(team[i].score<team[j].score)team[i].rank++;
		}
	}
	for(int i=1;i<=n;i++){
		cout << team[i].rank<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());

int main(){
	int n;
	cin>>n;
	vint v(n);
	rep(i,n*(n-1)/2){
		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]++;
		}
	}
	vector<pii> vp;
	rep(i,n){
		vp.PB(mkp(-v[i],i));
	}
	sort(ALL(vp));
	int t1=vp[0].F,t2=1;
	rep(i,n){
		if(t1==vp[i].F){
			v[vp[i].S]=t2;
		}
		else{
			t1=vp[i].F;
			v[vp[i].S]=i+1;
			t2=i+1;
		}
	}
	rep(i,n){
		cout<<v[i]<<endl;
	}
}

C++: // 基本テンプレート
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;
 
signed main() {
    int N; cin >> N;

    vector< pair<int, int> > point(N);
    vector<int> ans(N);
    for(int i=0; i<N; i++) point[i].second = 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) {
            point[A].first++;
            point[B].first++;
        }
        else if(C < D) {
            point[B].first += 3;
        }
        else {
            point[A].first += 3;
        }
    }
    sort(point.rbegin(), point.rend());

    int rank = 1, pre = -1;
    for(int i=0; i<N; i++) {
        if(pre < 0) {
            pre = point[i].first;
            ans[ point[i].second ] = rank;
        }
        else if(pre == point[i].first) {
            ans[ point[i].second ] = rank;
        }
        else {
            rank = i+1;
            ans[ point[i].second ] = rank;
        }
        pre = point[i].first;
    }

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

C++: #include <iostream>
#include <algorithm>

#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

int n;
int p[100];

int main(){
	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];
			--p[b];
		}
		else{
			if(c < d){
				swap(a, b);
			}
			p[a] -= 3;
		}
	}

	vector<int> v(p, p + n);
	sort(v.begin(), v.end());
	rep(i, n){
		cout << lower_bound(v.begin(), v.end(), p[i]) - v.begin() + 1 << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int N,n[100],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++: #include<iostream>
#include<algorithm>

using namespace std;

typedef struct{
  int num;
  int point;
  int pos;
}Team;


int main(){
  int num;
  cin >> num;
  Team data[num+1];

  for(int i = 0; i <= num; i++){
    data[i].num = i;
    data[i].point = 0;
  }
  
  for(int i = 0; i < num*(num-1)/2; i++){
    int in[4];
    cin >> in[0] >> in[1] >> in[2] >> in[3];
    if(in[2] > in[3]) data[in[0]].point += 3;
    else if(in[2] < in[3]) data[in[1]].point += 3;
    else{
      data[in[0]].point++;
      data[in[1]].point++;
    }
  }
  for(int i = 1; i < num; i++){
    for(int j = 1; j <= num-i; j++){
      if(data[j].point < data[j+1].point){
	Team tmp;
	tmp = data[j];
	data[j] = data[j+1];
	data[j+1] = tmp;
      }
    }
  }
  int out[num+1];
  out[data[1].num] = 1;
  int nowp = data[1].point, pos = 1, eq = 0;
  for(int i = 2; i <= num; i++){
    if(data[i].point == nowp){
      out[data[i].num] = pos;
      eq++;
    }
    else{
      nowp = data[i].point;
      pos+=eq;
      eq = 0;
      pos++;
      out[data[i].num] = pos;
    }
  }
  for(int i = 1; i <= num; i++) cout << out[i] << endl;
  return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int n,a,b,pa,pb,point[101],rank[101];

		for(int i = 0;i < 101;++i){
			point[i] = rank[i] = 0;
		}
		for(int i = 0;i < ((n*(n-1))/2);++i){
			cin >> a >> b >> pa >> pb;
			--a; --b;
			if(pa > pb) point[a] += 3;
			else if(pa < pb) point[b] += 3;
			else {
				++point[a];
				++point[b];
			}
		}
		for(int i = 0;i < n;++i){
			a = 1;
			pa = point[i];
			for(int j = 0;j < n;++j){
				if(pa < point[j]) ++a;
			}
			rank[i] = a;
		}
		for(int i = 0;i < n;++i){
			cout << rank[i] << endl;
		}
	
	return 0;
}