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])
	}
}

Python: n = int(input())

score = [list(map(lambda x: int(x) - 1 , input().split())) for _ in range(int(n*(n-1)/2))]

points = [0 for _ in range(n)]

for a,b,c,d in score:
    if c > d:
        points[a] += 3
    elif c < d:
        points[b] += 3
    else:
        points[a] += 1
        points[b] += 1

rank = sorted(points)
rank.reverse()

for p in points: 
    print(rank.index(p) + 1)

Python: INF = 1000000000000
n = int(input())
rank = [0 for i in range(n)]
plst = [[0, i] for i in range(n)]

for i in range(n * (n - 1) // 2):
  a,b,c,d = map(int,input().split())
  if c == d:
    plst[a - 1][0] += 1
    plst[b - 1][0] += 1
  elif c < d:
    plst[b - 1][0] += 3
  else:
    plst[a - 1][0] += 3

plst.sort(reverse=True)

count = 0
same_num = 1
pre_point = INF

for p in plst:
  point = p[0]
  t_num = p[1]
  if point < pre_point:
    pre_point = point
    count += same_num
    rank[t_num] = count
    same_num = 1
  elif point == pre_point:
    same_num += 1
    rank[t_num] = count

for r in rank:
  print(r)

Python: n=int(input())
point=[0]*(n+1)
for i in range(int(n*(n-1)/2)):
    a,b,c,d=map(int,input().split())
    if c>d:
        point[a]+=3
    elif d>c:
        point[b]+=3
    elif c==d:
        point[a]+=1
        point[b]+=1
point_s=point[:]
point_s.sort(reverse=True)
for i in point[1:]:
    print(point_s.index(i)+1)

Python: def f():
 from heapq import heappop, heappush
 N=int(input())
 r=[0]*N
 for _ in[0]*(N*~-N//2):
  a,b,c,d=map(int,input().split())
  r[a-1]+=3*(c>d)+(c==d)
  r[b-1]+=3*(d>c)+(d==c)
 b=[[]for _ in[0]*N*3]
 for i in range(N):b[r[i]]+=[i]
 pq = []
 for i, s in enumerate(r):heappush(pq,[-s,i])
 rank=1
 display_rank=1
 prev_score=float('inf')
 while pq:
  s,i=heappop(pq)
  if s!=prev_score:rank=display_rank
  r[i]=rank
  display_rank+=1
  prev_score=s
 print(*r,sep='\n')
f()

Python: n = int(input())
point = [0] * n
for i in range(n * (n - 1) // 2):
    A, B, X, Y = map(int, input().split())
    if X > Y:
        point[A - 1] += 3
    elif Y > X:
        point[B - 1] += 3
    else:
        point[A - 1] += 1
        point[B - 1] += 1

point_sorted = sorted(point, reverse=True)

for i in range(n):
    print(point_sorted.index(point[i]) + 1)

Python: n = int(input())
score = [0]*n
for i in range(n*(n-1)//2):
    x, y, a, b = map(int, input().split())
    if a > b:
        score[x-1] += 3
    elif a < b:
        score[y-1] += 3
    else:
        score[x-1] += 1
        score[y-1] += 1

s = [1]*n
for i in range(n):
    for j in range(n):
        if score[i] < score[j]:
            s[i] += 1
    print(s[i])

Python: n=int(input());score=[list(map(lambda x:int(x)-1,input().split())) for _ in range(int(n*(n-1)/2))];points= [0]*n
for a,b,c,d in score: 
    if c>d:points[a]+=3 
    elif c<d:points[b]+=3 
    else:points[a]+=1;points[b]+=1
rank=sorted(points,reverse=True)
for p in points:print(rank.index(p)+1)

Python: N=int(input())
s=[0]*N
for _ in[0]*(N*~-N//2):
 a,b,c,d=map(int,input().split())
 s[a-1]+=3*(c>d)+(c==d)
 s[b-1]+=3*(d>c)+(d==c)
b=[[]for _ in[0]*N*3]
for i in range(N):
 b[s[i]]+=[i]
r=1
for x in b[::-1]:
 for y in x:
  s[y]=r
 if x:r+=len(x)
print(*s,sep='\n')

Python: n = int(input())

score = [list(map(lambda x: int(x) - 1 , input().split())) for _ in range(int(n*(n-1)/2))]

points = [0 for _ in range(n)]

for a,b,c,d in score:
    if c > d:
        points[a] += 3
    elif c < d:
        points[b] += 3
    else:
        points[a] += 1
        points[b] += 1

rank = sorted(points, reverse=True)

for p in points: 
    print(rank.index(p) + 1)

Python: t = int(input())
point_l = [0 for i in range(t)]
for i in range(int(t*(t-1)/2)):
    tmp = [int(x) for x in input().split()]
    if tmp[2] > tmp[3]:
        point_l[tmp[0]-1] += 3
    elif tmp[3] > tmp[2]:
        point_l[tmp[1]-1] += 3
    elif tmp[2] == tmp[3]:
        point_l[tmp[0]-1] += 1
        point_l[tmp[1]-1] += 1

rank_l = [0 for i in range(t)]
rank = 1
for l in sorted(point_l, reverse=True):
    dup = point_l.count(l)
    for j in range(dup):
        rank_l[point_l.index(l)] += rank
        point_l[point_l.index(l)] = -1
    rank += dup

for l in rank_l:
    print(l)

Python: n = int(input())
l = [list(map(int,input().split())) for i in range(n*(n-1)//2)]
p = [[0,i,0] for i in range(n+1)]

for i in range(n*(n-1)//2):
    if l[i][2] == l[i][3]:
        p[l[i][0]][0] += 1
        p[l[i][1]][0]  += 1
    elif l[i][2] > l[i][3]:
        p[l[i][0]][0]  += 3
    else:
        p[l[i][1]][0]  += 3

p = sorted(p,key = lambda x:-x[0])
p.pop(-1)

rank = 1
k = [p[i][0] for i in range(n)]

for i in range(n):
    if k.count(p[i][0]) == 1:
        p[i][2] = rank
        rank += 1

    else:
        p[i][2] = rank
        if i+2 == rank + k.count(p[i][0]):
            rank += k.count(p[i][0])

p = sorted(p,key = lambda x:x[1])
for i in range(n):
    print(p[i][2])

Python: def f():
 from heapq import heappop, heappush
 N=int(input())
 r=[0]*N
 for _ in[0]*(N*~-N//2):
  a,b,c,d=map(int,input().split())
  r[a-1]+=3*(c>d)+(c==d)
  r[b-1]+=3*(d>c)+(d==c)
 b=[[]for _ in[0]*N*3]
 for i in range(N):b[r[i]]+=[i]
 pq = []
 for i, s in enumerate(r):heappush(pq,[-s,i])
 rank=1
 display_rank=1
 prev_score=float('inf')
 while pq:
  s,i=heappop(pq)
  if s!=prev_score:rank=display_rank
  r[i]=rank
  display_rank+=1
  prev_score=s
 print(*r,sep='\n')
f()

Python: def f():
 N=int(input())
 s=[0]*N
 for _ in[0]*(N*~-N//2):
  a,b,c,d=map(int,input().split())
  s[a-1]+=3*(c>d)+(c==d)
  s[b-1]+=3*(d>c)+(d==c)
 b=[[]for _ in[0]*N*3]
 for i in range(N):b[s[i]]+=[i]
 r=1
 for x in b[::-1]:
  for y in x:s[y]=r;r+=1
 print(*s,sep='\n')
f()

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0566

"""
import sys
from sys import stdin
from heapq import heappop, heappush
input = stdin.readline


def main(args):
    N = int(input())
    scores = [0] * (N+1)
    scores[0] = -1
    results = [-1] * (N+1)

    for _ in range(N*(N-1)//2):
        a, b, c, d = [int(x) for x in input().split()]
        if c > d:
            scores[a] += 3
        elif c < d:
            scores[b] += 3
        else:
            scores[a] += 1
            scores[b] += 1

    pq = []
    for i, s in enumerate(scores[1:], start=1):
        heappush(pq, [-s, i])

    rank = 1
    display_rank = 1
    prev_score = float('inf')
    while pq:
        s, i = heappop(pq)
        if s == prev_score:
            results[i] = rank
        else:
            rank = display_rank
            results[i] = rank
        display_rank += 1
        prev_score = s

    for r in results[1:]:
        print(r)



if __name__ == '__main__':
    main(sys.argv[1:])