## main

n = gets.strip.to_i
nn = n * (n - 1) / 2

ws = n.times.map{0}

nn.times do
  ai, bi, asc, bsc = gets.strip.split(' ').map{|s| s.to_i}
  ai -= 1
  bi -= 1

  if asc == bsc
    ws[ai] += 1
    ws[bi] += 1
  elsif asc > bsc
    ws[ai] += 3
  else
    ws[bi] += 3
  end
end

tws = (0...n).zip(ws).sort{|a, b| b[1] <=> a[1]}

cod = 0
psc = 0
pnm = 1

tos = []

for i in (0...n)
  ti, tsc = tws[i]

  if psc != tsc
    cod += pnm
    pnm = 1
    tos[ti] = cod
    psc = tsc
  else
    pnm += 1
    tos[ti] = cod
  end
end

puts tos