n=int(eval(input()));score=[list([int(x)-1 for x in 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))
n=int(eval(input()));s=[list(map(int,input().split())) for _ in range(int(n*(n-1)/2))];p=[0]*n

for a,b,c,d in s: 

    if c>d:p[a-1]+=3 

    elif c<d:p[b-1]+=3 

    else:p[a-1]+=1;p[b-1]+=1

r=sorted(p,reverse=True)

for q in p:print((r.index(q)+1))
n = int(eval(input()))
score = [
    list([int(x) - 1 for x in 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))

n = int(eval(input()))
s = [list(map(int, input().split())) for _ in range(int(n * (n - 1) / 2))]
p = [0] * n
for a, b, c, d in s:
    if c > d:
        p[a - 1] += 3
    elif c < d:
        p[b - 1] += 3
    else:
        p[a - 1] += 1
        p[b - 1] += 1
r = sorted(p, reverse=True)
for q in p:
    print((r.index(q) + 1))

-score = [ -    list([int(x) - 1 for x in input().split()]) for _ in range(int(n * (n - 1) / 2)) -] -points = [0] * n -for a, b, c, d in score: +s = [list(map(int, input().split())) for _ in range(int(n * (n - 1) / 2))] +p = [0] * n +for a, b, c, d in s: -        points[a] += 3 +        p[a - 1] += 3 -        points[b] += 3 +        p[b - 1] += 3 -        points[a] += 1 -        points[b] += 1 -rank = sorted(points, reverse=True) -for p in points: -    print((rank.index(p) + 1)) +        p[a - 1] += 1 +        p[b - 1] += 1 +r = sorted(p, reverse=True) +for q in p: +    print((r.index(q) + 1))