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<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<long long, int> ll_i;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << (x) << "\n"
#define debug2(x, y) cout << " --- " << (x) << " " << (y) << "\n"
#define debug3(x, y, z) cout << " --- " << (x) << " " << (y) << " " << (z) << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)

pair<int, i_i> tab[100];

bool xsort(pair<int, i_i> qwe, pair<int, i_i> rty){
  return qwe.X > rty.X;
}
bool ysort(pair<int, i_i> qwe, pair<int, i_i> rty){
  return qwe.Y.X < rty.Y.X;
}

signed main(void){
  int i, j;
  for(int testcase = 0;testcase >= 0;testcase++){
    int(n);
    rep(i, n)tab[i] = mp(0, mp(i, 0));
    rep(i, n * (n - 1) / 2){
      int4(a, b, c, d);
      --a; --b;
      if(c == d){
        ++tab[a].X;
        ++tab[b].X;
      }else if(c > d){
        tab[a].X += 3;
      }else{
        tab[b].X += 3;
      }
    }
    sort(tab, tab + n, xsort);
    tab[0].Y.Y = 1;
    rep1(i, n){
      if(tab[i - 1].X == tab[i].X)tab[i].Y.Y = tab[i - 1].Y.Y;
      else tab[i].Y.Y = i + 1;
    }
    sort(tab, tab + n, ysort);
    rep(i, n)pri(tab[i].Y.Y);



/*/

//*/ break;
  }
  return 0;
}

C++: //
//  main.cpp

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;


int main(){	
	int n;
	int team[3][101];
	int point[3][101];
	int gets[101];
	for(int i = 0;i<3;i++)for(int j=0;j<101;j++)gets[j] = team[i][j] = point[i][j]= 0;
	
	cin >> n;
	for(int i=0;i<n*(n-1)/2;i++){
		cin >> team[0][i] >> team[1][i] >> point[0][i] >> point[1][i];
	}
	
	for(int i=0;i<n*(n-1)/2;i++){
		if(point[0][i] > point[1][i]){
			gets[team[0][i]] += 3;
		}else if(point[0][i] < point[1][i]){
			gets[team[1][i]] += 3;
		}else{
			gets[team[0][i]] += 1;
			gets[team[1][i]] += 1;
		}
	}
	
	vector <pair<int,int>> vec;
	for(int i=1;i<=n;i++){
		vec.push_back(make_pair(gets[i],i));//?????°?????????
	}
	sort(vec.begin(),vec.end());
	int answer[101]={};
	int memo = -1;
	int count = 0;
	for(int i=n-1;i>=0;i--){
		if(memo == vec[i].first){
			count ++;
		}else{
			memo = vec[i].first;
			count = 0;
		}
		answer[vec[i].second] = n - i - count;
	}
	for(int i=1;i<=n;i++){
		cout << answer[i] << endl;
	}
	
	return 0;
}

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

struct Team{
	int index,score,rank;
	Team(){score=0;}
};

bool rank_ask(const Team &a,const Team &b){
	if(a.score>b.score)return true;
	return false;
}
bool index_ask(const Team &a,const Team &b){
	if(a.index<b.index)return true;
	return false;
}

int main(){
	int n;
	Team team[101];
	std::cin>>n;
	for(int i=0;i<n;i++)team[i].index=i;
	for(int i=0;i<(n*(n-1)/2);i++){
		int a,b,c,d;
		std::cin>>a>>b>>c>>d;
		if(c>d)team[a-1].score+=3;
		else if(c==d)team[a-1].score++,team[b-1].score++;
		else team[b-1].score+=3;
	}
	std::sort(team+0,team+n,rank_ask);
	for(int i=0;i<n;i++)team[i].rank=i+1;
	std::sort(team+0,team+n,index_ask);
	for(int i=0;i<n;i++)std::cout<<team[i].rank<<std::endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n;i>=0;i--)
#define INF 100000005
#define MAX 100001
#define mp make_pair
#define pb push_back
#define fi first
#define se second
using namespace std;
//__gcd(a,b), __builtin_popcount(a);

pair<int,int> a[101];
int b[101];
bool comp(pair<int,int> x, pair<int,int> y){
	return x.fi > y.fi;
}

int main(){
	int n, m, t[4], p, s = INF;
	scanf("%d", &n);
	m = (n*(n-1))/2;
	rrep(i,n)a[i].se = i;
	rep(i,m){
		rep(j,4)scanf("%d", &t[j]);
		if(t[2] > t[3])a[t[0]].fi += 3;
		if(t[2] < t[3])a[t[1]].fi += 3;
		if(t[2] == t[3])a[t[0]].fi++, a[t[1]].fi++;
	}
	sort(a+1, a+n+1, comp);
	rrep(i,n)printf("%d %d\n", a[i].fi, a[i].se);
	for(int i = 1;i <= n;i++){
		if(s > a[i].fi){
			s = a[i].fi;
			p = i;
		}
		a[i].fi = p;
		b[a[i].se] = i;
	}
	rrep(i,n)printf("%d\n", a[b[i]].fi);
	return 0;
}

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

int main()
{
	int n;
	int a,b,c,d;
	int team[100];
	int p[100];
	int sum=0;

	cin >> n;
	for(int i=1 ;i<n+1 ;i++){
		team[i] = 0;
		p[i] = 1;
	}

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

		else if(c == d){
			team[a]++;
			team[b]++;
		}
	}
	for(int i=1 ;i<n+1 ;i++){
		for(int j=1 ;j<n+1 ;j++){
			if(team[i] < team[j]){
				p[i]++;
			}
		}
	}
	for(int i=1 ;i<n+1 ;i++){
		cout << p[i] << endl;
	}


	return 0;
}

C++: #include <iostream>

using namespace std;

int main (void) {
  int G[101][101] = {0}, sum[101] = {0}, rank[101] = {0};
  int a, b, c, d;
  int n;

  cin >> n;

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

  for(int i = 1; i <= n; i++) {
    for(int j = 1; j <= n; j++) {
      if (i == j) continue;
      sum[i] += G[i][j];
    }
  }

  //cout << sum[0] << " " << sum[1] << " " << sum[2] << " " << sum[3] << endl;

  int daburi = 1;

  // rankの出し方は俺が考えたアルゴリズムじゃない
  for(int i = 1; i <= n; i++) {
    rank[i] = 1;
    for(int j = 1; j <= n; j++) {
      if(sum[i] < sum[j]) rank[i]++;
    }
  }

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

  return 0;
}