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<vector>
#include<algorithm>
using namespace std;

bool f(int x,int y){if(x<y)return false; return true;}

int main(){
	int n,m,p[102]={0};
	vector<int> sor;
	scanf("%d",&n);
	m=n*(n-1)/2;
	for(int i=0;i<m;i++){
		int a,b,c,d;
		scanf("%d%d%d%d",&a,&b,&c,&d);
		if(c>d)p[a]+=3;
		if(c==d){p[a]++; p[b]++;}
		if(c<d)p[b]+=3;
	}
	for(int i=1;i<=n;i++){
		sor.push_back(p[i]);
	}
	sort(sor.begin(),sor.end(),f);
	for(int i=1;i<=n;i++){
		for(int j=0;;j++){
			if(p[i]==sor[j]){printf("%d\n",j+1); break;}
		}
	}
}

C++: //============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
int A[101],B[101],C[101],D[101];
int N,M;
int S[101]={};
int main() {
	cin>>N;
	for(int i=0;i<(N*(N-1)/2);i++){
		cin>>A[i]>>B[i]>>C[i]>>D[i];
		if(C[i]>D[i])S[A[i]]+=3;
		if(C[i]<D[i])S[B[i]]+=3;
		if(C[i]==D[i])S[A[i]]+=1,S[B[i]]+=1;
	}

	int T=0;
	for(int i=1;i<N+1;i++){
		T=1;
		for(int j=1;j<N+1;j++){
			if(S[i]<S[j])T+=1;
		}
		cout<<T<<endl;

	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
using namespace std;
typedef pair< int , int > P;
#define fr first
#define sc second

int main(){
  int N;
  P pt[100];
  cin >> N;
  for(int i = 0 ; i < N ; i++ ) pt[i].sc = i,pt[i].fr = 0;
  for(int i = 0 ; i < N * (N - 1) / 2 ; i++ ){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if(c > d) pt[a-1].fr += 3;
    else if(c < d) pt[b-1].fr += 3;
    else pt[a-1].fr++, pt[b-1].fr++;
  }
  int ANSER[N],cnt = 2;
  sort(pt,pt+N,greater<P>());
  ANSER[pt[0].sc] = 1;
  for(int i = 1, flg = 2 ; i < N ; i++ ){
    if(pt[i].fr == pt[i-1].fr) cnt--;
    else cnt = flg;
    ANSER[pt[i].sc] = cnt;
    cnt++, flg++;
  }
  for(int i = 0 ; i < N ; i++ ) cout << ANSER[i] << endl;
}

C++: #include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)

//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};

int N;
int A[5001];
int B[5001];
int C[5001];
int D[5001];
int team[101];
int main()
{
  cin >>N;
  for(int i = 1;i <= N*(N-1)/2;i++){
    cin>>A[i]>>B[i]>>C[i]>>D[i];
    if(C[i] >D[i]){
      team[A[i]] +=3;
    }else if(C[i] <D[i]){
      team[B[i]] +=3;
    }else{
      team[A[i]]++;
      team[B[i]]++;
    }   
  }
  int score[101] ={0};
  int k = 1;
    for(int n = 1;n <=N+1;n++){
      int tempmax = -1;
      bool flag1 = false;
      for(int i =1;i <=N;i++){
	if(tempmax <team[i]){
	  tempmax = team[i];
	  flag1 =true;
	}
      }
    if(!flag1){
       for(int l = 1;l <=N;l++){
	  cout <<score[l]<<endl;
      }
       return 0;
    }
    bool flag =false;
    int kasan = 0;

    for(int j = 1;j <=N;j++){
    if(tempmax ==team[j]){
      if(flag =true){
	kasan++;
      }
      score[j] = k;
      team[j] =team[j]-(tempmax+2);
      flag = true;
    }
    }
    k+=kasan;
    }
  return 0;
}

C++: #include <iostream>
using namespace std;
int n,game,a,b,c,d;
typedef struct{
	int rank;
	int score;
}Team;
Team team[100];
int main(){
	cin >> n;
	game =n*(n-1)/2;
	for(int i=0;i<game;i++){
		cin >> a >>b >> c >>d;
		if(c>d){
			team[a].score+=3;
			team[b].score+=0;
		}else if(c==d){
			team[a].score+=1;
			team[b].score+=1;
		}else{
			team[a].score+=0;
			team[b].score+=3;
		}
	}
	for(int i=1;i<=n;i++){
		team[i].rank=1;
		for(int j=1;j<=n;j++){
			if(team[i].score<team[j].score)team[i].rank++;
		}
	}
	for(int i=1;i<=n;i++){
		cout << team[i].rank<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int team[100];
    for(int i=0;i<100;i++)team[i]=0;
    int n;
    cin>>n;
    int m=(n*(n-1))/2;
    for(int i=0;i<m;i++){
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        if(c==d){
            team[a-1]++;
            team[b-1]++;
        }
        else team[max(a,b)-1]+=3;
    }
    for(int i=0;i<n;i++)cout<<team[i]<<endl;
    return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>

using namespace std;

#define sz			size()
#define lgt			length()
#define rep(i,n)	for (int i = 0; i < n; i++)
#define ALL(X)		(X).begin(),(X).end()
#define RALL(X)		(X).rbegin(),(X).rend()
#define pb			push_back
#define SORT(a)		sort(ALL(a));
#define RSORT(a)	sort(RALL(a));
#define mp			make_pair
#define dump(x)		cerr<<#x<<" = "<<(x)<<endl;
#define fir			first
#define sec			second

typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<string> vs;

int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
vs form(string a,char s){vs v;string b;rep(i,a.lgt){if(a[i]==s){v.pb(b);b="";}else b+=a[i];}v.pb(b);return v;}
vi formint(string a,char s){vi v;string b;rep(i,a.lgt){if(a[i]==s){v.pb(toInt(b));b="";}else b+=a[i];}v.pb(toInt(b));return v;}

const double EPS=1e-10,PI=acos(-1.0);
const int INF=2100000000;

int res[128], rank[128];
vector <P> ans;

int main(void)
{
	int n;
	cin >> n;
	int len = n * (n - 1) / 2;
	int a, b, c, d;
	for (int i = 0; i < len; i++){
		cin >> a >> b >> c >> d;
		if (c < d) res[b] += 3;
		else if (d < c) res[a] += 3;
		else { res[a]++;	res[b]++; }
	}
	for (int i = 1; i <= n; i++){
		ans.pb(mp(res[i], i));
	}
	RSORT(ans);
	
	int cnt = 1, num = 1;
	for (int i = 0; i < n; i++){
		if (ans[i].fir == ans[i + 1].fir){
			num++;
			rank[ans[i].sec] = cnt;
		}
		else {
			rank[ans[i].sec] = cnt;
			cnt += num;
			num = 1;
		}
	}
	
	for (int i = 1; i <= n; i++){
		cout << rank[i] << endl;
	}
	
	return 0;
}