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<cstdio>
#include <iostream>
#include <string>
#include<algorithm>
#include <map>
#pragma warning(disable:4786)  // VisualC++6.0の警告対策



using namespace std;

#define ll long long
#define SINT(n) scanf("%d",&n);
#define SINT2(n,m) scanf("%d %d",&n,&m);
#define SINT3(n,m,o) scanf("%d %d %d",&n,&m,&o);
#define SINT4(n,m,o,p) scanf("%d %d %d %d",&n,&m,&o,&p);
#define SLL(n) scanf("%lld",&n);
#define SST(s) scanf("%s",&s);

#define PINT(n) printf("%d",(int)(n));
#define PINT2(n,m) printf("%d %d",(int)(n),(int)(m));
#define PLL(n) printf("%lld",(long long)(n));
#define PST(s) printf("%s",(s));
#define PCH(s) printf("%c",(s));

#define PINTN(n) printf("%d\n",(int)(n));
#define PINT2N(n,m) printf("%d %d\n",(int)(n),(int)(m));
#define PLLN(n) printf("%lld\n",(long long)(n));
#define PSTN(s) printf("%s\n",(s));
#define PCHN(s) printf("%c\n",(s));

#define PSP() printf(" ");
#define PN() printf("\n");


#define dlp(i) while(i-->0)
#define ulp(i) for(ll _hoge_counter_hoge_=i,i=0;i<_hoge_counter_hoge_;i++)

#define lp(i) for(ll _hoge_counter_hoge_=i;_hoge_counter_hoge_--;)
#define lpp(i,to) for(i=0;i<to;i++)
#define lpft(i,from,to) for(i=from;i<to;i++)

#define lengthof(x)

#define FILL(a,v)(a, a + (sizeof (a) / sizeof *(a)), v);


map<ll, map<ll, short> > memo[50][50][4];

char Map[60][60];

int main(){

	int N;
	int i,j,k;
	int a,b,c,d;
	int t[100];

	FILL(t,0);

	SINT(N);

	
	lpp(i,N*(N-1)/2){
		SINT4(a,b,c,d);
		if(c>d){
			t[a-1]+=3;
		}
		if(c<d){
			t[b-1]+=3;
		}
		if(c==d){
			t[a-1]++;
			t[b-1]++;
		}
	}

	lpp(i,N){
		a=1;
		lpp(j,N){
			if(t[j]>t[i]) a++;
		}
		PINTN(a);
	}
	
	return 0;
}

C++: // 2012/02/22 Tazoe

#include <iostream>
using namespace std;

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

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

	for(int i=0; i<N*(N-1)/2; i++){
		int A, B, C, D;
		cin >> A >> B >> C >> D;

		if(C>D){
			T[A-1][1] += 3;
		}
		else if(C<D){
			T[B-1][1] += 3;
		}
		else{
			T[A-1][1] += 1;
			T[B-1][1] += 1;
		}
	}

	for(int i=0; i<N-1; i++){
		for(int j=i+1; j<N; j++){
			if(T[i][1]<T[j][1]){
				int tmp = T[i][0];
				T[i][0] = T[j][0];
				T[j][0] = tmp;
				tmp = T[i][1];
				T[i][1] = T[j][1];
				T[j][1] = tmp;
				tmp = T[i][2];
				T[i][2] = T[j][2];
				T[j][2] = tmp;
			}
		}
	}

	T[0][2] = 1;
	for(int i=1; i<N; i++){
		if(T[i][1]==T[i-1][1]){
			T[i][2] = T[i-1][2];
		}
		else{
			T[i][2] = i+1;
		}
	}

	for(int i=0; i<N-1; i++){
		for(int j=i+1; j<N; j++){
			if(T[i][0]>T[j][0]){
				int tmp = T[i][0];
				T[i][0] = T[j][0];
				T[j][0] = tmp;
				tmp = T[i][1];
				T[i][1] = T[j][1];
				T[j][1] = tmp;
				tmp = T[i][2];
				T[i][2] = T[j][2];
				T[j][2] = tmp;
			}
		}
	}

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

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod2 = 1000000007;
constexpr ll mod = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,-1};
const int dy[6] = {0, 1, 0, -1,1,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// ---------------------------------------------------------------------------

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin >> N;
    vector<int> cnt(N,0);
    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){
            cnt[b] += 3;
        }else if(c > d){
            cnt[a] += 3;
        }else{
            cnt[a]++;
            cnt[b]++;
        }
    }
    vector<P> suzu(N);
    for(int i=0; i<N; i++){
        suzu[i] = P(cnt[i],i);
    }
    sort(suzu.begin(),suzu.end(),greater<P>());
    vector<int> id(N);
    id[suzu[0].second] = 1;
    for(int i=1; i<N; i++){
        if(suzu[i].first == suzu[i-1].first){
            id[suzu[i].second] = id[suzu[i-1].second];
        }else{
            id[suzu[i].second] = i+1;
        }
    }
    for(int i=0; i<N; i++){
        cout << id[i] << enld;
    }
    return 0;
}

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

typedef queue<int> Que;
int team[101], a, b, c, d, rank[101], k[101];
int n;
int main(){
  int tmp, l = 0, p = 1;
  Que q;
  cin >> n;
  for(int i = 0; i < n * (n - 1) / 2; i++){
    cin >> a >> b >> c >> d;
    if(c > d) team[a - 1] += 3;
    else if(c < d) team[b - 1] += 3;
    else team[a - 1]++, team[b - 1]++;
  }
  for(int i = 0; i < n; i++){
    k[i] = team[i];
  } 
  sort(k, k + n);
  reverse(k, k + n);
  tmp = k[0];
  q.push(tmp);
  for(int i = 1 ; i < n; i++){
    if(tmp == k[i]) continue;
    q.push(k[i]);
    tmp = k[i];
  }
  while(!q.empty()){
    l = 0;
    int u = q.front();
    q.pop();
    for(int i = 0; i < n; i++){
      if(team[i] == u){
	rank[i] = p;
	l++;
      }
    }
    if(l > 1)  p += l;
    else p++;
  }
  for(int i = 0; i < n; i++) cout << rank[i] << endl;
}

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

int data[100];

int main(){
	int n;
	scanf("%d",&n);
	for(int i = 0; i < n * (n - 1) / 2; i++){
		int b[4];
		for(int k=0;k<4;k++) scanf("%d",&b[k]);
		if(b[2]>b[3]) data[b[0]-1]+=3;
		if(b[2]<b[3]) data[b[1]-1]+=3;
		if(b[2]==b[3]){ data[b[0]-1]++; data[b[1]-1]++; }
	}
	for(int i=0;i<n;i++){
		int res=1;
		for(int j=0;j<n;j++){
			if(data[i]<data[j]) res++;
		}
		printf("%d\n",res);
	}
}

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

int main(){
	int N;
	int score[101];
	vector<int> res;
	int A, B, C, D;
	int rank[101];
	int n, r;
	
	scanf("%d", &N);
	for(int i = 1; i <= N; i++){
		score[i] = 0;
	}
	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++){
		res.push_back(score[i]);
	}
	sort(res.begin(), res.end(), greater<int>());
	res.erase(unique(res.begin(), res.end()), res.end());
	n = 0;
	for(int i = 0; i < res.size(); i++){
		r = n + 1;
		for(int j = 1; j <= N; j++){
			if(res[i] == score[j]){
				rank[j] = r;
				n++;
			}
		}
	}
	
	for(int i = 1; i <= N; i++){
		printf("%d\n", rank[i]);
	}
	
	return 0;
}