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<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
int main(){
    int n;
    cin>>n;
    vi v(n+1,0);
    rep(i,n*(n-1)/2){
        pii a,b;
        cin>>a.first>>b.first;cin>>a.second>>b.second;
        if(a.second==b.second){v[a.first]++; v[b.first]++;}
        else{
            a.second>b.second ? v[a.first]+=3:v[b.first]+=3;
        }
    }
        vi hoge;
        rep(i,n)hoge.push_back(v[i+1]);
        sort(hoge.begin(),hoge.end(),greater<int>());
        rep(i,n){
            for(int j=0;j<n;j++){
                if(hoge[j]==v[i+1]){cout<<j+1<<endl; break;}
            }
        }
    }

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
    int n; //the number of teams
    cin >> n;
    int SC[n];
    for (int i = 1; i <= n; i++) {
        SC[i] = 0;
    }
    for (int i = 0; i < (n * n - n) / 2; i++) {
        int te1, te2; //team
        cin >> te1 >> te2;
        int sc1, sc2; //score
        cin >> sc1 >> sc2;
        if (sc1 > sc2) {
            SC[te1] += 3;
            SC[te2] += 0;
        } else if (sc1 == sc2) {
            SC[te1] += 1;
            SC[te2] += 1;
        } else {
            SC[te1] += 0;
            SC[te2] += 3;
        }
    }
    vector<pair<int, int> > v;
    for (int i = 1; i <= n; i++) {
        v.push_back(make_pair(SC[i], i));
    }
    sort(v.begin(), v.end());
    for (int i = n - 1; i >= 0; --i) {
        if (i != n - 1 && v[i].first == v[i + 1].first) {
            SC[v[i].second] = SC[v[i + 1].second];
        } else {
            SC[v[i].second] = n - 1 - i + 1;
        }
    }
    for (int i = 1; i <= n; i++) {
        cout << SC[i] << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <cctype>
#include <complex>
#include <string>
#include <sstream>
#include <cassert>
using namespace std;

//common
#define BR "\n"

#define ALL(c) (c).begin(),(c).end()
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define EACH(it,o) for(auto it = (o).begin(); it != (o).end(); ++it)
#define IN(l,v,r) ((l)<=(v) && (v)<(r))

typedef vector<int> vi; typedef pair<int,int> pii; typedef vector<pair<int,int> > vpii;
typedef long long ll; typedef vector<long long> vl; typedef pair<long long,long long> pll; typedef vector<pair<long long,long long> > vpll;
typedef vector<string> vs; typedef long double ld;

//config
#define MODE_DEBUG
//#define INF 1<<30
//#define EPS 1e-8
//const ll MOD =100000007;

//debug
#ifdef MODE_DEBUG
#define  DUMP(x)  cerr << #x << " = " << (x) <<endl
#define DEBUG(x) DUMP(x) << " (L" << __LINE__ << ")" << " " << __FILE__<<endl
#define CHECK(exp,act)  if(exp!=act){DUMP(exp);DEBUG(act);}
#define STOP(e)  CHECK(e,true);if(!(e)) exit(1);
#else
#define DUMP(x)
#define DEBUG(x)
#define CHECK(exp,act)
#define STOP(e)
#endif

template<class T> inline string toString(const vector<T>& x) {
	stringstream ss;
	REP(i,x.size()){
		if(i!=0)ss<<" ";
		ss<< x[i];
	}
	return ss.str();
}
template<class T> inline string toString(const vector<vector<T>>& map) {
	stringstream ss;
	REP(i,map.size()){
		if(i!=0)ss<<BR;
		ss<< toString(map[i]);
	}
	return ss.str();
}
template<class K,class V>  string toString(map<K,V>& x) {
	string res;stringstream ss;
	for(auto& p:x)ss<< p.first<<":" << p.second<<" ";
	return ss.str();
}

template<typename T,typename V> inline T mod(T v,V MOD){
	return (v%MOD+MOD)%MOD;
}

struct T{
	int id,p,rank;
	T():id(-1),p(0),rank(-1){}
	T(int id,int p,int rank):id(id),p(p),rank(rank){}
	bool operator < (const T& t) const{
		return p>t.p;
	}
};
bool comp (const T& t1,const T& t2){
		return t1.id<t2.id;
}

int main(){
	int N;cin >>N;
	vector<T> ts(N);
	for(int i=0;i<N;i++){
		ts[i].id=i;
	}
	for(int i=0;i<N*(N-1)/2;i++){
		int f,t,fp,tp;cin >> f>>t>>fp>>tp;f--;t--;
		if(fp<tp)ts[t].p+=3;
		else if(fp>tp)ts[f].p+=3;
		else{
			ts[f].p+=1;ts[t].p+=1;
		}
	}
	sort(ALL(ts));
	int rank=0;int p=-1;int dup=1;
	for(int i=0;i<N;i++){
		if(ts[i].p==p){
			dup++;
			ts[i].rank=rank;
		}else{
			rank+=dup;
			ts[i].rank=rank;
			dup=1;p=ts[i].p;
		}
	}
	sort(ALL(ts),comp);
	for(int i=0;i<N;i++){
		cout<<ts[i].rank<<endl;	
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

#define str to_string
#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()

#define MAX_N 101

int N;
int score[MAX_N];
int ranks[MAX_N];

int main() {
  cin >> N;
  // scoring
  rep(i, N*(N-1)/2) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;

    if (c == d) {
      score[a-1] += 1;
      score[b-1] += 1;
    }
    else if (c > d) score[a-1] += 3;
    else            score[b-1] += 3;
  }

  // ranking
  int num = 1;
  for (int i=1+(3*(N*(N-1)/2)); i>0; i--) {
    int c = 0;
    rep(j, N) {
      if (score[j] == i) {
        ranks[j] = num;
        c++;
      }
    }
    num += c;
  }
  // print
  rep(i, N) cout << ranks[i] << '\n';
  return 0;
}