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 <stdio.h>
#include <algorithm>

int N, A[5000], B[5000], C[5000], D[5000];
int point[112][2], ans[112];

int main(void) {
	scanf("%d", &N);
	for (int i = 0; i < N*(N - 1) / 2; ++i) { scanf("%d%d%d%d", &A[i], &B[i], &C[i], &D[i]); }

	for (int i = 0; i < N*(N - 1) / 2; ++i) {
		if (C[i] < D[i]) { point[B[i] - 1][0] += 3; }
		if (C[i] > D[i]) { point[A[i] - 1][0] += 3; }
		if (C[i] == D[i]) { point[A[i] - 1][0]++; point[B[i] - 1][0]++; }
	}
	for (int i = 0; i < N; ++i) { point[i][1] = i + 1; }
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			if (point[i][0] > point[j][0]) {
				std::swap(point[i][0], point[j][0]);
				std::swap(point[i][1], point[j][1]);
			}
		}
	}
	for (int i = 0; i < N; ++i) {
		if (point[i][0] == point[i + 1][0]) {
			ans[point[i][1] - 1] = i + 1, ans[point[i + 1][1] - 1] = i + 1; i++;
		}
		else { ans[point[i][1] - 1] = i + 1; }
	}
	for (int i = 0; i < N; ++i) { printf("%d\n", ans[i]); }
	return 0;
}

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

typedef pair<int,int> P;

int main(){
  P m[100];
  int n,a,b,c,d;
  int p[100],r[100];

  cin >> n;
  for(int i=0;i<n;i++)p[i] = 0;
  int N = n*(n-1)/2;
  for(int i=0;i<N;i++){
    cin >> a >> b >> c >>d;
    a--;b--;
    if(c>d)p[a] += 3;
    else if(c<d)p[b] += 3;
    else {
      p[a]++; p[b]++;
    }
  }

  for(int i=0;i<n;i++)m[i] = P(p[i],i);

  sort(m,m+n,greater<P>());

  r[m[0].second] = 1;
  for(int i=1;i<n;i++){
    if(m[i-1].first == m[i].first)r[m[i].second] = r[m[i-1].second];
    else r[m[i].second] = i+1;
  }

  for(int i=0;i<n;i++)cout << r[i] << endl;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
  int t1,t2,s1,s2;
  int p[1000];
  int n;
  while( cin >> n){
    for(int i = 0 ; i < 1000; i++)p[i] = 0;

    int m = n*(n - 1)/2;

    while(m--){
      cin >> t1 >> t2 >> s1 >> s2;
      if(s1 > s2)p[t1-1]+=3;
      else if(s1 < s2)p[t2-1]+=3;
      else {
	p[t1-1]++;
	p[t2-1]++;
      }
    }

    int cnt;
    for(int i =  0 ; i < n ; i++ ){
      cnt = 1;
      for(int j =  0 ; j < n ; j++ ){
	if(p[i] < p[j])cnt++;
      }
      cout << cnt << endl;
    }
  }
  return 0;
}

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

int main(){

  int z[1000] = {0},n,a,b,c,d,x[1000] = {0},tmp,count = 0;
  cin >> n;

  for(int i=0;i<n*(n-1)/2;i++){
    cin >> a >> b >> c >> d;

    if(c > d) z[a-1] += 3;
    else if(d > c) z[b-1] += 3;
    else if(c == d){

      z[a-1]++;
      z[b-1]++;

    }
  }

  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(z[i] < z[j]) count++;
    }
      x[i] = count;
      count = 0;
    }
 
  for(int i=0;i<n;i++) cout << x[i]+1 << endl;
}

C++: #include<iostream>
using namespace std;
int main(){
	int i, j, n, n1, ten[1000] = { 0 }, a, b, c, d, jun[10000];
	cin >> n;
	n1 = n*(n - 1) / 2;
	for (i = 0; i < n1; i++){
		cin >> a >> b >> c >> d;
		if (c > d){
			ten[a] += 3;
		}
		else if (d > c){
			ten[b] += 3;
		}
		else{
			ten[a]++;
			ten[b]++;
		}
	}
	for (i = 0; i < n1; i++){
		for (j = 0; j < n1; j++){
			if (ten[i] < ten[j]){
				jun[i]++;
			}
		}
	}

	for (i = 1; i < n + 1; i++){
		jun[i]++;
		cout << jun[i] << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fr first
#define sc second
typedef vector<int> Vi;
typedef pair<int,int> Pii;
typedef pair<int,Pii> Pip; 
const int INF = (1<<30);
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){

  int n;
  int p[100] = {0};
  int rank[100] = {0};
  cin >> n;
  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 ) p[a] += 3;
    if( c < d ) p[b] += 3;
    if( c == d ) { p[a]++; p[b]++; }
  }

  for(int i=0; i<n; i++) {
    for(int j=0; j<n; j++) {
      if( i != j ) {
	if( p[i] < p[j] ) rank[i]++;
      }
    }
  }

  for(int i=0; i<n; i++) {
    cout << rank[i]+1 << endl;
  }
}

C++: #include <bits/stdc++.h>

using namespace std;

#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;i++)
#define FORVEC(i, v) for(int i = 0;i < v.size();i++)

#define INF 1000000000
#define pb(a) push_back(a)
#define vi vector<int>
#define vvi vector<vi>
#define P pair<int,int>
#define all(vec) (vec.begin()),(vec.end())
#define ll long long int;
#define sz(x) ((int)(x).size())
#define in(x) int x;cin>>x;
#define bit(n) (1<<(n))


template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }


int main(){
	int n;
	int a,b,c,d;
	int p[100]={};
	vi pp;
	cin>>n;
	REP(i,(n*(n-1))/2){
		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]++;
		}
	}
	REP(i,n){
		pp.pb(p[i]);
	}
	sort(all(pp),greater<int>());
	/*
	REP(i,n)cout<<p[i]<<" ";cout<<"\n\n";
	REP(i,n)cout<<pp[i]<<" ";cout<<"\n";
	//*/
	REP(i,n){
		auto iter=find(all(pp),p[i]);
		cout<<distance(pp.begin(),iter)+1<<"\n";
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>

using namespace std;

int main() {
  int n, team[100], rank[100];

  for (int i=0; i<100; i++) {
    team[i]=0;
    rank[i]=1;
  }
  
  cin >> n;
  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) {
      team[a]+=0;team[b]+=3;
    } else if (c==d) {
      team[a]+=1;team[b]+=1;
    } else {
      team[a]+=3;team[b]+=0;
    }
  }

  for (int i=1; i<n; i++) {
    for (int j=0; j<i; j++) {
      if (team[i] < team[j]) {
	rank[i]++;
      } else if (team[i] > team[j]) {
	rank[j]++;
      }
    }
  }

  for (int i=0; i<n; i++)
    printf("%d\n", rank[i]);

  return 0;
}

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


int d[111];

int main(){

  int n;
  vector<pair<int, int> > v;
  cin >> n;
  for(int i = 0; i <= n; i++){
    v.push_back(make_pair(0,0));
  }
  for(int i = 0; i < (n*(n-1))/2; i++){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    v[a].second = a;
    v[b].second = b;
    if(c > d){
      v[a].first += 3;

    }else if(d > c){
      v[b].first += 3;

    }else {
      v[a].first += 1;
      v[b].first += 1;
    }
  }



  for(int i = 1; i <= n; i++){
    int cnt = 1;
    for(int j = 1; j <= n; j++){
      if(v[i].first < v[j].first){
	cnt++;
      }
    }
    cout << cnt << endl;
  }





}