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>
int main()
{
	int a[101] = { 0 }, b[101] = { 0 }, c[101] = { 0 }, d[100] = { 0 },hideo, masatoy, nagase,ruio=0,temp=0;
	scanf("%d", &hideo);
	nagase = hideo*(hideo - 1) / 2;
	for (int i = 1; i <= hideo; i++) {
		c[i] = i;
	}
	for (int i = 1; i <= nagase; i++) {
		scanf("%d %d %d %d", &a[1], &a[2], &a[3], &a[4]);
		if (a[3] > a[4]) {
			b[a[1]] += 3;
		}
		else if (a[3] < a[4]) {
			b[a[2]] += 3;
		}
		else {
			b[a[1]] += 1;
			b[a[2]] += 1;
		}
	}
	for (int i = 1; i <= hideo; i++) {
		for (int j = 1; j <= hideo; j++) {
			if (b[j] > ruio) {
				ruio =b[j];
			}
		}
		for (int j = 1; j <= hideo; j++) {
			if (b[j] == ruio) {
				if (ruio != -1) {
					d[j] = i;
					b[j] = -1;
					temp++;
				}
			}
		}
		if (temp >1)i++;
		temp = 0;
		ruio = -1;
	}
	/*for (int i = 1; i <= hideo; i++) {
		for (int j = hideo; j > i; j--) {
			if (b[j] > b[j - 1]) {
				masatoy = b[j];
				b[j] = b[j - 1];
				b[j - 1] = masatoy;
				masatoy = c[j];
				c[j] = c[j - 1];
				c[j - 1] = masatoy;
			}

			
		}
	}*/
	for (int i = 1; i <= hideo; i++) {
		printf("%d\n", d[i]);
	}
}

C++: #include<bits/stdc++.h>
#define N 105
using namespace std;
typedef pair<int,int> P;
int n,a,b,c,d,ans[N],cnt,prevx;
P x[N];

int main(){
  cin>>n;
  for(int i=0;i<n;i++)x[i].second=i+1;
  for(int i=0;i<n*(n-1)/2;i++){
    cin>>a>>b>>c>>d;
    if(c==d)x[a-1].first++,x[b-1].first++;
    else if(c<d)x[b-1].first+=3;
    else x[a-1].first+=3;
  }
  sort(x,x+N,greater<P>());
  cnt=1;
  prevx=x[0].first;
  for(int i=0;i<n;i++){
    if(prevx>x[i].first){
      cnt=i+1;
      prevx=x[i].first;
    }
    ans[x[i].second-1]=cnt;
  }
  for(int i=0;i<n;i++)
    cout<<ans[i]<<endl;
  return 0;
}

C++: #include "bits/stdc++.h"

#define X first
#define Y second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)

using namespace std;

using I = int;
using L = long;
using F = float;
using S = string;
using SS = stringstream;
using C = char;
using LL = long long;
using VI = vector<int>;
using VL = vector<long>;
using VF = vector<float>;
using VS = vector<string>;
using PLL = pair<long, long>;
using PLF = pair<long, float>;
using PLS = pair<long, string>;
using PSL = pair<string, long>;
using PSF = pair<string, float>;
using PSS = pair<string, string>;
using MLL = map<long, long>;
using MLF = map<long, float>;
using MLS = map<long, string>;
using MSL = map<string, long>;
using MSF = map<string, float>;
using MSS = map<string, string>;

const long kMax2 = 109;
const long kMax3 = 1009;
const long kMax4 = 10009;
const long kMax5 = 100009;
const long kMax6 = 1000009;
const long kInfI = 0x3F3F3F3F;
const float kInfF = 1e15;

template <class T>
void PrintVector(vector<T> & v, unsigned n) {
  rep(i, 0, n - 1) {
    cout << v[i] << " ";
  }
  cout << endl;
}

int main(int argc, char const *argv[]) {
  L n;
  VL v(kMax3, 0);
  cin >> n;
  rep(i, 0, n * (n - 1) / 2 - 1) {
    L a, b, c, d;
    cin >> a >> b >> c >> d;
    if (c > d) { v[a - 1] += 3; }
    else if (c < d) { v[b - 1] += 3; }
    else { ++v[a - 1]; ++v[b - 1]; }
  }
  VL count(kMax3, 0);
  rep(i, 0, n - 1) {
    ++count[v[i]];
  }
  per(i, 3 * n - 1, 0) {
    count[i] += count[i + 1];
  }
  rep(i, 0, n - 1) {
    cout << count[v[i] + 1] + 1 << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
signed main(){
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  long long n,a,b,c,d,win[110]={};
  cin>>n;
  for(int i=0;i<n*(n-1)/2;i++){
    cin>>a>>b>>c>>d;
    if(c>d) win[a]+=3;
    else if(c<d) win[b]+=3;
    else{
      win[a]++;
      win[b]++;
    }
  }
  long long rank[110];
  for(int i=1;i<=n;i++){
    rank[i]=1;
    for(int j=1;j<=n;j++){
      if(win[i]<win[j]){
	rank[i]++;
      }
    }
  }
  for(int i=1;i<=n;i++) cout<<rank[i]<<'\n';
  return(0);
}

C++: #include <iostream>
#include <algorithm>
#include <utility>
#include <set>
using namespace std;
int ten[110]={},jun[110];
int main(){
	set<int> se;
	set<int>::iterator it;
	int N,Gn,a,b,c,d,las;
	cin>>N;
	Gn=N*(N-1)/2;
	for(int i=0;i<Gn;i++){
		cin>>a>>b>>c>>d;
		if(c>d){
			ten[a-1]+=3;
		}
		else if(c<d){
			ten[b-1]+=3;
		}
		else{
			ten[a-1]++;
			ten[b-1]++;
		}
	}
	for(int i=0;i<N;i++)jun[i]=1;
	for(int i=1;i<N;i++){
		for(int j=0;j<i;j++){
			if(ten[j]<ten[i]) jun[j]++;
			if(ten[j]>ten[i]) jun[i]++;
		}
	}
	for(int i=0;i<N;i++){
		cout<<jun[i]<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(void){
	int a, b=0, c, d, e[10000]={0}, g[10000]={0}, i, j, f,k;
	cin >> a;
	b=a*(a-1)/2;
	for(i=1;i<=b;i++){
		cin >> c >> d >> f >> k;
		if(f > k){
			g[c] = g[c] + 3;
		}
		else if(k > f){
			g[d] = g[d] + 3;
		}
		else{
			g[c]++;
			g[d]++;
		}
	}
	for(i=1;i<=a;i++){
		for(j=1;j<=a;j++){
			if(g[i]<g[j]){
				 e[i]++;
			}
		}
	}
	for(i=1;i<=a;i++){
	e[i]++;
	cout << e[i] << endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
	int n,i,j;
	int t1,t2,b1,b2,box[5000],v[5000];
	scanf("%d",&n);
	for(i=0;i<n*(n-1)/2;i++){
		v[i]=0;	box[i]=1;
	}
	for(i=0;i<n*(n-1)/2;i++){
		scanf("%d %d %d %d",&t1,&t2,&b1,&b2);
		if(b1>b2)	v[t1]+=3;
		if(b1<b2)	v[t2]+=3;
		if(b1==b2){
			v[t1]++;
			v[t2]++;
		}
	}
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
			if(v[i]>v[j])	box[j]++;
		}
	}
	for(i=1;i<=n;i++){
		printf("%d\n",box[i]);
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
#include<algorithm>
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 <iostream>
using namespace std;

int main(){
  int t[110]={};
  int N;
  cin >> N;
  int a,b,c,d;
  //得点
  for(int i = 0; i < N*(N-1)/2; i++){
    cin >> a >> b >> c >> d;
    if(c > d) t[a-1] += 3;
    else if(c < d) t[b-1] += 3;
    else if(c == d){
      t[a-1]++;
      t[b-1]++;
    }
  }
 for(int i = 0; i < N; i++){
    cout << t[i] << endl;
  }
  //順位
  int rank[110]={};
  for(int j = 1; j < N+1; j++){
    int max = -1,indx=0;
    for(int i = 0; i < N; i++){
      if(max < t[i]){
	max = t[i];
	indx = i;
      }
    } 
    rank[indx] = j;
    t[indx] = -1;
  }
  for(int i = 0; i < N; i++){
    cout << rank[i] << endl;
  }
  return 0;
}