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>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF (1<<29)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
const int dx[] = {-1,0,0,1},dy[] = {0,1,-1,0};

typedef long long int ll;

using namespace std;

int main(){
    int n;
    cin >> n;
    int c = n*(n-1)/2;
    int m = 0;
    vector<int> v(n,0);
    REP(i,c){
	int a,b,c,d;
	cin >> a >> b >> c >> d;
	a--;
	b--;
	if(c > d) v[a] += 3;
	else if(d > c) v[b] += 3;
	else{
	    v[a]++;
	    v[b]++;
	}
	m = max(m,v[a]);
	m = max(m,v[b]);
    }
    vector<int> ans(n);
    int rank = 1;
    while(m >= 0){
	bool flg = false;
	int count = 0;
	REP(i,n){
	    if(v[i] == m){
		ans[i] = rank;
		flg = true;
		count++;
	    }
	}
	if(flg){
	    rank += count;
	}
	m--;
    }
    REP(i,n) cout << ans[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;
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
int main(){
  int n;
  int i,j,k;
  cin >> n;
  int s[105]={},r[105]={};
  P p[105];
  for(i=0;i<105;i++){
    p[i].first=0;
    p[i].second=i;
  }
  
  int a,b,c,d;
  for(i=0;i<n*(n-1)/2;i++){
    cin >> a >> b >> c >> d;
    if(c==d){
      p[a].first++;
      p[b].first++;
    }
    if(c<d){
      p[b].first+=3;
    }
    if(c>d){
      p[a].first+=3;
    }
  } 

  //  for(i=1;i<=n;i++) cout << p[i].first << endl;
  sort(p,p+105,greater<P>());
  k=1;
  for(i=0;i<105;i++){
    r[p[i].second]=k;
    j=1;
    while(i<105-1){
      if(p[i].first==p[i+1].first){
	i++;
	j++;
	r[p[i].second]=k;
	continue;
      }
      break;
    }
    k+=j;
  }
  for(i=1;i<=n;i++){
    cout << r[i] << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<set>
#include<algorithm>
using namespace std;
int main(){
  set <int> nums;
  int a[10000],b[10000],c[10000],d[10000],i,j,N,ch[10000]={0},cp[10000]={0},h[10000]={0},p=0,g=0,o[1000]={0},k=0,y=1;
  cin >> N;
  for(i=1;i<=N*(N-1)/2;i++){
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for(i=1;i<=N*(N-1)/2;i++){
    if(c[i]>d[i]){
      ch[a[i]]=ch[a[i]]+3;
    }
    else if(c[i]<d[i]){
      ch[b[i]]=ch[b[i]]+3;
    }
    else if(c[i]==d[i]){
      ch[a[i]]++;
      ch[b[i]]++;
    }
  }
  for(i=1;i<=N;i++){
    cp[i]=ch[i];
  }
  sort(cp+1,cp+N+1);
  reverse(cp+1,cp+N+1);
  for(i=1;i<=N;i++){
    if(k!=cp[i]){
    o[y]=cp[i];
    }
    k=cp[i];
    y++;
  }
  for(i=1;i<=N;i++){
    for(j=1;j<=N;j++){
      if(o[i]==ch[j]){
	h[j]=i;
	
      }
    }
  }
  for(i=1;i<=N;i++){
    cout << h[i] << endl;
  }
}

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

using namespace std;

int main(){
  int n;
  cin>>n;
  int s[100]={},ss[100]={};
  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){
      s[(c>d)?a:b]+=3;
    }else{
      s[a]++;
      s[b]++;
    }
  }
  copy(s,s+n,ss);
  sort(ss,ss+n);
  for(int i=0;i<n;i++){
    cout<<n-(upper_bound(ss,ss+n,s[i])-ss)+1<<endl;
  }
  return 0;
}

C++: #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <climits>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define ALL(A)		(A).begin(),(A).end()
#define DUMP(A)    cout<<#A<<"="<<(A)<< endl
#define SIZE(A)    (int)((A).size())
#define MP  make_pair
using namespace std;
typedef long long ll;

int vx[]={1,0,-1,0},vy[]={0,1,0,-1};

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