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<string>
 
using namespace std;
 
int main(){
    int n;
	int a[105],b[105],c[105],d[105];
	int t[105],k[105];
	cin>>n;
	for(int i=0;i<(n*(n-1))/2;i++){
		cin>>a[i]>>b[i]>>c[i]>>d[i];
		t[i]=0;
	}
	for(int i=0;i<(n*(n-1))/2;i++){
		if(c[i]>d[i])
			t[a[i]]+=3;
		if(c[i]<d[i])
			t[b[i]]+=3;
		if(c[i]==d[i]){
			t[a[i]]++;
			t[b[i]]++;
		}
	}
	int j=1;
	int h=0;
	for(int g=n*3;g>=0;g--){
		for(int i=1;i<n+1;i++){
			if(g==t[i]){
				k[i]=j;
				h++;
			}
		}
		j+=h;
		h=0;
    }
	for(int i=1;i<n+1;i++){
		cout<<k[i]<<endl;
	}
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
using namespace std;
int main(void){
  int n;cin>>n;
  vector<int> v(n,0);
  for(int i=0,a,b,c,d;i<n*(n-1)/2;++i){
    cin>>a>>b>>c>>d;
    if(c!=d)v[(c>d)?a-1:b-1]+=3;
    else{++v[a-1];++v[b-1];}
  }
  map<int,int,greater<int> > rank;
  for(int i=0;i<n;++i)++rank[v[i]];
  int r=1;
  for(map<int,int>::iterator it=rank.begin();it!=rank.end();++it){
  	int t=it->second;
  	it->second=r;
  	r+=t;
  }
  for(int i=0;i<n;++i) cout<<rank[v[i]]<<endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
#include<aigorithm>
int main()
{
	int sta[101]={},stb[101]={};
	int A,B,C,D,i,n,m,j;
	cin>>n;
	for(i=1;i<=n;i++){
		sta[i]=i;
	}
	m=n*(n-1)/2;
	for(i=0;i<m;i++){
		cin>>A>>B>>C>>D;
		if(C>D){
			stb[A]+=3;
		}
		else if(C<D){
			stb[B]+=3;
		}
		else{
			stb[B]++;
			stb[A]++;
		}
	}
	for(i=1;i<=n-1;i++){
		for(j=i+1;j<n;j++){
			if(stb[i]<stb[j]){
				m=stb[i];
				stb[i]=stb[j];
				stb[j]=m;
			}

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

C++: #include <stdio.h>
int main(void)
{
	int n,a[4],t[100],p[100],i,j,k;
	scanf("%d",&n);
	for(i=0;i!=n;++i)
		t[i]=0;
	for(i=0;i!=n*(n-1)/2;i++){
		for(j=0;j!=4;j++)
			scanf("%d",&a[j]);
		if(a[2]<a[3])
			t[a[1]-1]+=3;
		else if(a[2]>a[3])
			t[a[0]-1]+=3;
		else{
			t[a[0]-1]+=1;
			t[a[1]-1]+=1;
		}
	}
	for(i=0;i!=n;++i)
		p[i]=t[i];
	for(i=0;i!=n;++i){
		for(j=i;j!=n;j++){
			if(p[i]<p[j]){
				k=p[i];
				p[i]=p[j];
				p[j]=k;
			}
		}
	}
	for(i=0;i!=n;++i){
		for(j=0;j!=n;++j){
			if(t[i]==p[j]){
				printf("%d\n",j+1);
				break;
			}
		}
	}
}

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

int main() {
	int n ,team1 ,team2 ,score1 ,score2 ,a[100]={} ,save[100]={} ,r;
	cin>>n;
	for(int i=0;i<(n*(n-1)/2);i++){
		team1=0;
		team2=0;
		score1=0;
		score2=0;
		cin>>team1>>team2>>score1>>score2;
		if(score1>score2){
			a[team1]+=3;
		}
		else if(score1<score2){
			a[team2]+=3;
		}
		else if(score1=score2){
			a[team1]++;
			a[team2]++;
		}
	}
	for(int i=1;i<=n;i++){
		save[i]=a[i];
	}
	sort(a,a+n+1);{
	for(int i=1;i<=n;i++){
		for(int l=1;l<n;l++){
			if(a[l]==save[i]){
				cout<<n-l+1<<endl;	
			}
		}
	}
}
return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
int main() {
	int N; cin >> N;
	vector<int>scores(N);
	set<int>nums;
	for (int i = 0; i < N*(N - 1) / 2; ++i) {
		int A, B; cin >> A >> B; A--; B--;
		int C, D; cin >> C >> D;
		if (C > D)scores[A] += 3;
		else if (C == D) {
			scores[A]++;
			scores[B]++;
		}
		else {
			scores[B] += 3;
		}
	}
	vector<int>sortscores(scores);
	sort(sortscores.begin(), sortscores.end(),greater<int>());
	for (auto s : scores) {
		cout << find(sortscores.begin(), sortscores.end(), s) - sortscores.begin() + 1 << endl;
	}
	return 0;
}

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

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

int main() {
	int point[100], rank[100], n;
	bool table[301];
	cin >> n;
	
	memset(point, 0, sizeof(point));
	REP(i,n*(n-1)/2) {
		int a, b, c, d;
		scanf("%d %d %d %d", &a, &b, &c, &d);
		point[a-1] += c > d ? 3 : (c < d ? 0 : 1);
		point[b-1] += c < d ? 3 : (c > d ? 0 : 1);
	}

	memset(table, 0, sizeof(table));
	REP(i, n) table[point[i]] = true;
	
	for (int i = 300, k = 1; i >= 0; i--) if (table) {
		int count = 0;
		REP(j, n) if (point[j] == i) {
			rank[j] = k;
			count++;
		}
		k += count;
	}

	REP(i, n) cout << rank[i] << endl;

	return 0;
}

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define INF (1<<29)
using namespace std;
typedef long long ll;
int main(){
      int p[100];
      int n;
      cin>>n;
      memset(p,0,sizeof(p));
      REP(i,n*(n-1)/2){
            int a,b,c,d;
            cin>>a>>b>>c>>d;a--;b--;
            if(c>d)p[a]+=3;
            else if(d>c)p[b]+=3;
            else{
                  p[a]++;
                  p[b]++;
            }
      }
      int r[100];
      int k=1;
      for(int i=300;i>=0;i--){
            int cnt=0;
            REP(j,n){
                  if(p[j]==i)cnt++;
            }
            if(cnt==0)continue;
            REP(j,n){
                  if(p[j]==i)r[j]=k;
            }
            k+=cnt;
      }
      REP(i,n){
            cout<<r[i]<<endl;
      }
}