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 <algorithm>
#include <map>

using namespace std;

int n;
pair<int, int> point[100];
int ans[100];

main(){
  cin >> 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[a].first += 3;
    }else{
      point[b].first += 3;
    }
  }
  sort(point, point+n);
  int tmp = 1;
  int pre = -1;
  for(int i=n-1, j=0;i>=0;i--, j++){
    if(point[i].first == pre){
      ans[point[i].second] = tmp;
    }else{
      ans[point[i].second] = j+1;
      tmp = j+1;
    }
    pre = point[i].first;
  }
  for(int i=0;i<n;i++){
    cout << ans[i] << endl;
  }
  return 0;
}

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x, n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair< int, int > P;
typedef pair< int, P > PP;

//------------------------------------------------

int n;
int sum[100];

int f(int x, int y) {
	return x > y ? 3 : x == y ? 1 : 0;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

	cin >> n;
	REP(i, n * (n - 1) / 2) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		a--, b--;
		sum[a] += f(c, d);
		sum[b] += f(d, c);
	}
	vector<P> v;
	REP(i, n) v.pb(P(sum[i], i));
	sort(ALL(v));
	reverse(ALL(v));
	int rank[n], now = 1, prv_pt = -1;
	REP(i, n) {
		if (v[i].fi == prv_pt) {
			rank[v[i].se] = now;
		}
		else {
			rank[v[i].se] = i + 1;
			prv_pt = v[i].fi;
			now = i + 1;
		}
	}
	REP(i, n) cout << rank[i] << endl;

	return 0;
}

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

using namespace std;

struct DATA{
  int number;
  int score;
  int rank;
};

bool Compare1(const DATA&, const DATA&);
bool Compare2(const DATA&, const DATA&);

int main(){
  int i, n, m, a, b, c, d;
  DATA onedata;
  vector<DATA> data;

  cin >> n;
  for(i=0; i<n; ++i){
    onedata.number = i+1;
    onedata.score = 0;
    onedata.rank = 0;
    data.push_back(onedata);
  }

  m = n * (n-1) / 2;
  for(i=0; i<m; ++i){
    cin >> a >> b >> c >> d;
    if(c > d){
      data[a-1].score += 3;
    }else if(c < d){
      data[b-1].score += 3;
    }else{
      ++data[a-1].score;
      ++data[b-1].score;
    }
  }

  sort(data.begin(), data.end(), Compare1);

  data[0].rank = 1;
  for(i=1; i<data.size(); ++i){
    if(data[i].score == data[i-1].score)
      data[i].rank = data[i-1].rank;
    else
      data[i].rank = i+1;
  }

  sort(data.begin(), data.end(), Compare2);

  for(i=0; i<data.size(); ++i)
    cout << data[i].rank << endl;

  return 0;
}

bool Compare1(const DATA& x, const DATA& y){
  return (x.score > y.score);
}

bool Compare2(const DATA& x, const DATA& y){
  return (x.number < y.number);
}

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

int n;
int a, b, c, d;
int score[200], rank[200];

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

    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main(){
	int n, a, b, c, d;
	int score[101];
	int pnt[101];
	fill_n(pnt, 101, 0);
	vector<pair<int, int> > v;
	cin >> n;
	for(int i = 0; i < n*(n-1)/2; i++){
		cin >> a >> b >> c >> d;
		if(c < d) pnt[b]+=3;
		else if(c > d) pnt[a]+=3;
		else pnt[b]++, pnt[a]++;
	}
	for(int i = 1; i <= n; i++){
		v.push_back(make_pair(pnt[i], i));
	}
	sort(v.begin(), v.end());
	int index = 0;
	int before = 0;
	int same = 0;
	for(int i = v.size() - 1; i >= 0; i--){
		if(v[i].first == before){
			same++;
			score[v[i].second] = index;
		}else{
			index += same + 1;
			score[v[i].second] = index;
			before = v[i].first;
			same = 0;
		}
	}

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

	return 0;
}

C++: 
#include<iostream>
#include<string>
  
using namespace std;
  
int main(){
    int n;
    int a[11000],b[11000],c[11000],d[11000];
    int t[11000],k[11000];
    cin>>n;
    for(int i=0;i<(n*(n-1))/2;i++){
        cin>>a[i]>>b[i]>>c[i]>>d[i];
        t[i]=0;
    }
    for(int i=0;i<(n*(n-1))/2;i++){
        if(c[i]>d[i])
            t[a[i]]+=3;
        if(c[i]<d[i])
            t[b[i]]+=3;
        if(c[i]==d[i]){
            t[a[i]]++;
            t[b[i]]++;
        }
    }
    int j=1;
    int h=0;
    for(int g=n*3;g>=0;g--){
        for(int i=1;i<n+1;i++){
            if(g==t[i]){
                k[i]=j;
                h++;
            }
        }
        j+=h;
        h=0;
    }
    for(int i=1;i<n+1;i++){
        cout<<k[i]<<endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int N, i, p, q, j, flg;
int GET[101][101], PNT[101], Order[101];
int main(){
    cin >> N;
    for (i=1; i<=N; i++) { PNT[i] = 0; Order[i]=1;}
    for (p=1; p<=N; p++) {
        for (q=1; q<=N; q++) {
            GET[p][q] = 9999;
        }
    }
    for (i=1; i<=(N*(N-1)/2); i++) {
        cin >> p >> q;
        cin  >> GET[p][q] >> GET[q][p];
    }
    for (p=1; p<=N; p++) {
        for (q=p+1; q<=N; q++) {
            if(p == q) { continue;}
            if (GET[p][q] > GET[q][p]) {
               PNT[p] += 3;
            } else {
                if (GET[p][q] > GET[q][p]) {
                PNT[q] += 3;
                } else {
                    PNT[p] += 1; PNT[q] += 1;
                }
            }
        }
     }
     for (p=1; p<=N; p++) {
         for (q=1; q<=N; q++) {
             if(PNT[p]<PNT[q]){Order[p]++;}
         }
     }
     for (i=1; i<=N; i++) {
         cout << Order[i] << endl;
     }
     return 0;
}