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 <bits/stdc++.h>
using namespace std;

struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef queue<int> qi;
typedef stack<int> si;
typedef deque<int> dqi;

#define reps(i, a, b) for (int i = a; i < b; ++i)
#define rep(i, n) reps(i, 0, n)
#define REPS(i, a, b) reps(i, a, b)
#define REP(i, n) rep(i, n)
#define deps(i, a, b) for (int i = a; i >= b; --i)
#define dep(i, n) deps(i, n, 0)
#define DEPS(i, a, b) deps(i, a, b)
#define DEP(i, n) dep(i, n)

#define pf push_front
#define pb push_back
#define mp make_pair
#define fst first
#define FST fst
#define sec second
#define SEC sec
#define sz(obj) ((int)(obj).size())
#define all(v) (v).begin(), (v).end()
#define ALL(v) all(v)

const int INF = 999999999;
const int MOD = 1e9 + 7;
const int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; std::cin >> x; return x;}
template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << endl;
}
template <typename T> void print(T x) { std::cout << x << '\n'; }

signed main()
{
  int n = in();
  vi p(n);

  rep(i, n * (n - 1) / 2) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (c > d) p[a - 1] += 3;
    else if (c < d) p[b - 1] += 3;
    else p[a - 1]++, p[b - 1]++;
  }
  int log = 0, rank = 0, cnt = 0;
  vector<pair<int, int>> vp;
  rep(i, n) vp.pb(mp(p[i], i + 1));
  sort(all(vp));
  reverse(all(vp));
  vector<pair<int, int>> rankv;
  rep(i, n) {
    if (vp[i].fst == log) {
      rankv.pb(mp(vp[i].sec, rank));
      cnt++;
    }
    else {
      rank += cnt;
      rankv.pb(mp(vp[i].sec, ++rank));
      log = vp[i].fst;
      cnt = 0;
    }
  }
  sort(all(rankv));
  rep(i, n) print(rankv[i].sec);

  return (0);
}

C++: #include<cstdio>
#include<cstdlib>
using namespace std;
#define MAX_N 100

int n, i, t1, t2, s1, s2, r[MAX_N], rc[MAX_N], j;

int sort(const void *a, const void *b){
  return *(int*)b - *(int*)a;
}

int main(){
  scanf("%d", &n);
  for(i = 0; i < n; i++){
    r[i] = 0;
    rc[i] = 0;
  }
  for(i = 0; i < n * (n - 1) / 2; i++){
    scanf("%d %d %d %d", &t1, &t2, &s1, &s2);
    if(s1 == s2){
      r[t1 - 1]++;
      rc[t1 - 1]++;
      r[t2 - 1]++;
      rc[t2 - 1]++;
    }
    if(s1 > s2){
      r[t1 - 1] += 3;
      rc[t1 - 1] += 3;
    }
    if(s1 < s2){
      r[t2 - 1] += 3;
      rc[t2 - 1] += 3;
    }
  } 
  qsort(rc, n, sizeof(int), sort);
  for(i = 0; i < n; i++){
    for(j = 0; j < n; j++){
      if(r[i] == rc[j]){
	printf("%d\n", j + 1);
	break;
      }
    }
  }
  return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int N;
	cin>>N;
	int result[N];
	rep(i,N)result[i]=0;
	int a,b,c,d;
	rep(i,N*(N-1)/2){
		cin>>a>>b>>c>>d;
		a--;
		b--;
		if(c>d){
			result[a]+=3;
		}else if(c<d){
			result[b]+=3;
		}else{
			result[a]++;
			result[b]++;
		}
	}
	int team[N];
	rep(i,N)team[i]=i+1;
	/*rep(i,N){
		cout<<team[i]<<" "<<result[i]<<endl;
	}*/
	//cout<<endl;
	for(int i=N;i>=1;i--){
		for(int j=0;j<i-1;j++){
			if(result[j]<result[j+1]){
				int alt=result[j];
				result[j]=result[j+1];
				result[j+1]=alt;
				alt=team[j];
				team[j]=team[j+1];
				team[j+1]=alt;
			}
			//rep(i,N)cout<<team[i]<<" ";
			//cout<<endl;
		}
	}
	int rank[N];
	rep(i,N){
		rank[i]=i+1;
	}
	for(int i=N;i>=1;i--){
		for(int j=0;j<i-1;j++){
			if(team[j]>team[j+1]){
				int alt=result[j];
				result[j]=result[j+1];
				result[j+1]=alt;
				alt=team[j];
				team[j]=team[j+1];
				team[j+1]=alt;
				alt=rank[j];
				rank[j]=rank[j+1];
				rank[j+1]=alt;
			}
		}
	}
	//rep(i,N)cout<<team[i]<<" "<<result[i]<<" "<<rank[i]<<endl;
	//cout<<endl;
	int check[N];
	rep(i,N)check[i]=0;
	int cnt=1;
	rep(i,N){
		rep(j,N){
			if(result[i]==result[j] && i!=j){
				//cout<<"hit "<<i<<" "<<j<<endl;
				check[i]=cnt;
				check[j]=cnt;
				cnt++;
			}
		}
	}
	//rep(i,N)cout<<team[i]<<" "<<result[i]<<" "<<rank[i]<<" "<<check[i]<<endl;
	//cout<<endl;
	rep(i,N){
		if(check[i]){
			rep(j,N){
				if(check[i]==check[j]){
					if(rank[i]>rank[j]){
						rank[i]=rank[j];
					}else{
						rank[j]=rank[i];
					}
				}
			}
		}
	}
	rep(i,N)cout<<rank[i]<<endl;
	return 0;
}

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

using namespace std;

int main()
{
	int n;
	int score[100];
	int win[100];
	int gameteam1[10000];
	int gameteam2[10000];
	int t1score[10000];
	int t2score[10000];
	pair<pair<int, int>,pair<int,int> > sorter[100];
	pair<int, int> answer[100];

	for (int a = 0; a < 100; a++)
	{
		score[a] = 0;
		win[a] = 0;
	}

	for (int a = 0; a < 10000; a++)
	{
		gameteam1[a] = 0;
		gameteam2[a] = 0;
		t1score[a] = 0;
		t2score[a] = 0;
	}

	cin >> n;

	for (int a = 0; a < n*(n - 1) / 2; a++)
	{
		cin >> gameteam1[a] >> gameteam2[a] >> t1score[a] >> t2score[a];
	}

	for (int a = 0; a < n*(n - 1) / 2; a++)
	{
		if (t1score[a] == t2score[a])
		{
			score[gameteam1[a]-1]++;
			score[gameteam2[a]-1]++;
		}
		else
		{
			if (t1score[a] > t2score[a])
			{
				score[gameteam1[a]-1] += 3;
				win[gameteam1[a]-1]++;
			}
			else if (t1score[a] < t2score[a])
			{
				score[gameteam2[a]-1] += 3;
				win[gameteam2[a]-1]++;
			}
		}
	}

	for (int a = 0; a < n; a++)
	{
		sorter[a] = make_pair(make_pair(win[a], score[a]),make_pair(10000,a));
	}

	sort(sorter, sorter + n,greater<pair<pair<int,int>,pair<int,int> > >());

	sorter[0].second.first = 1;

	for (int a = 1; a < n; a++)
	{
		if (sorter[a].first.second == sorter[a - 1].first.second)
		{
			sorter[a].second.first = sorter[a - 1].second.first;
		}
		else
		{
			sorter[a].second.first = a + 1;
		}
	}

	for (int a = 0; a < n; a++)
	{
		answer[a] = make_pair(sorter[a].second.second, sorter[a].second.first);
	}

	sort(answer, answer + n);

	for (int a = 0; a < n; a++)
	{
		cout << answer[a].second << endl;
	}

	getchar();
	getchar();

	return 0;
}

C++: #include<stdio.h>

int n,team[100];

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