n = gets.to_i
b = []

for i in 0...n
  b[i] = 0
end

while gets
  a = $_.split(" ").map(&:to_i)
  if a[2] > a[3] then
    b[a[0]-1] += 3
  elsif  a[2] < a[3] then
    b[a[1]-1] += 3
  else
    b[a[0]-1] += 1
    b[a[1]-1] += 1
  end
end
c = b.sort.reverse
for i in 0...n
  p c.index(b[i]) + 1
end

