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 ;
typedef pair<int,int> pii ;
typedef pair<int,pii> pi3 ;

int n = 0 ;
int ans[3][120] = {0} ;

void sortSp( bool flg )
{
  vector<pi3> cmp ;
  int x = 0 ;
  int y = 0 ;
  int z = 2 ;

  if ( flg ) y = 1 ;
  else x = 1 ;

  for ( int i = 0 ; i < n ; i++ )
  {
    cmp.push_back( pi3( ans[x][i], pii( ans[y][i], ans[z][i] ) ) ) ;
  }

  if ( flg )
  {
    sort( cmp.begin(), cmp.end() ) ;
  }
  else
  {
    sort( cmp.begin(), cmp.end(), greater<pi3>() ) ;
  }

  for ( int i = 0 ; i < n ; i++ )
  {
    ans[x][i] = cmp[i].first ;
    ans[y][i] = cmp[i].second.first ;
    ans[z][i] = cmp[i].second.second ;
  }
}

void Rank()
{
  sortSp(0) ;

  for ( int i = 1 ; i <= n ; i++ )
  {
    int cmp = 0 ;
    ans[2][ i-1 ] = i ;
    for ( int j = i ; j <= n ; j++ )
    {
      if ( ans[1][ i-1 ] == ans[1][j] )
      {
        ans[2][j] = i ;
        cmp++ ;
      }
      else break ;
    }
    i += cmp ;
  }

  sortSp(1) ;
}

void solve( int A, int B, int C )
{
  if ( !C )
  {
    ans[1][ A-1 ] += 1 ;
    ans[1][ B-1 ] += 1 ;
  }
  else
  {
    if ( C > 0 )
    {
      ans[1][ A-1 ] += 3 ;
    }
    else if ( C < 0 )
    {
      ans[1][ B-1 ] += 3 ;
    }
  }
}

int main()
{
  int A = 0 ;
  int B = 0 ;
  int score[2] = {0} ;
  cin >> n ;
  for ( int i = 0 ; i < n*(n-1)/2 ; i++ )
  {
    cin >> A >> B >> score[0] >> score[1] ;
    ans[0][i] = i + 1 ;
    solve( A, B, (score[0]-score[1]) ) ;
  }
  Rank() ;
  for ( int i = 0 ; i < n ; i++ )
  {
    printf("%d\n", ans[2][i]) ;
  }
  return 0 ;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n=0;
	int m=0;
	int a[102];
	int b[4];
	int s[102];
	int i=0;
	int j=0;
	int k=0;
	int p=0;
	int l=0;
	
	cin>>n;
	m=n*(n-1)/2;
	for(i=0;i<102;i++){
		a[i]=0;
		s[i]=0;
	}
	for(i=0;i<m;i++){
		for(j=0;j<4;j++){
			cin>>b[j];
		}
		if(b[2]>b[3]){
			a[b[0]-1]=a[b[0]-1]+3;
		}
		if(b[2]<b[3]){
			a[b[1]-1]=a[b[1]-1]+3;
		}
		if(b[2]==b[3]){
			a[b[1]-1]=a[b[1]-1]+1;
			a[b[0]-1]=a[b[0]-1]+1;
		}
	}
	for(i=0;i<n;i++){
		p++;
		for(j=0;j<n;j++){
			if(a[k]<a[j]){
				k=j;
			}
		}
		if(a[k]==0){
			break;
		}
		for(j=k+1;j<n+2;j++){
			if(a[k]==a[j]){
				s[j]=p;
				a[j]=0;
				l++;
			}
		}
		s[k]=p;
		a[k]=0;
		k=0;
		p=p+l;
		l=0;
	}
	for(i=0;i<n;i++){
		cout<<s[i]<<endl;
	}
}

C++: #include<stdio.h>
#include<math.h>
#include<algorithm>
#include<cctype>
#include<string.h>
#include <stdlib.h>

#define PI 3.1415926
void swap(int* x, int* y) {
	int a = *x;
	int b = *y;
	*x = b;
	*y = a;
}
int factorial(int n);
int sum(int n, int*);
int ave(int n, int*);
int min(int n, int*), min(int n, int m);
int max(int n, int*), max(int n, int m);

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

int factorial(int n) {
	if (n > 0) {
		return n * factorial(n - 1);
	}
	else {
		return 1;
	}
}
int sum(int n, int *all) {
	int total = 0;
	for (int i = 0; i < n; ++i) {
		total += all[i];
	}
	return total;
}
int ave(int n, int *all) {
	int total = 0;
	for (int i = 0; i<n; ++i) {
		total += all[i];
	}
	return total / n;
}
int min(int n, int *all) {

	int min = all[0];
	for (int i = 1; i < n; ++i) {
		if (all[0] > all[i]) {
			min = all[i];
		}
	}
	return min;
}
int max(int n, int *all) {
	int max = all[0];
	for (int i = 1; i<n; ++i) {
		if (all[0]<all[i]) {
			max = all[i];
		}
	}
	return max;
}
int max(int n, int m) {
	if (n >= m) {
		return n;
	}
	else {
		return m;
	}
}
int min(int n, int m) {
	if (n >= m) {
		return m;
	}
	else {
		return n;
	}
}

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

int main(){
  int teamn = 0;
  cin >> teamn;
  vector<int> point(teamn,0);
  vector<int> run(teamn,0);
  vector<int> plist;
  vector<int> rank(teamn,1);
  int fteam1,fteam2;
  int point1,point2;
  for(int n = 0;n<(teamn*(teamn-1))/2;n++){
    cin >> fteam1 >> fteam2;
    cin >> point1 >> point2;
    fteam1 -= 1;
    fteam2 -= 1;
    if(point1 > point2){
      point[fteam1] += 3;
    }else
    if(point1 == point2){
      point[fteam1] += 1;
      point[fteam2] += 1;
    }else
    if(point1 < point2){
      point[fteam2] += 3;
    }
  }
  for(int g = 0;g<point.size();g++){
    run[g] = point[g];
  }
  sort(run.begin(),run.end(),greater<int>());
  //for(int n = 0;n<run.size();n++){
  //  if(run[n] != run[n+1]){
  //    plist.push_back(run[n]);
  //  }
  //}
  for(int n = 0;n<run.size();n++){
    for(int g = 0;g<point.size();g++){
      if(n == 0 && run[n] == point[g]){
        rank[g] = n;
      }
      if(run[n] == point[g] && n != 0){
        if(run[n] != run[n-1]){
          rank[g] = n;
        }
      }
    }
  }
  for(int n = 0;n<rank.size();n++){
    cout << rank[n]+1 << endl;
  }
  return 0;
}

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++)


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, t+sizeof(t), 0 );
	memset(t,sizeof(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;
}