n = gets.to_i
pt = Array.new(n).map{Array.new(2,0)}
for i in 0..(n-1)
  pt[i][0] = i
end
for i in 1..(n*(n-1)/2)
  a,b,c,d = gets.split.map(&:to_i)
  if c > d
    pt[a-1][1] += 3
  elsif c < d
    pt[b-1][1] += 3
  else
    pt[a-1][1] += 1
    pt[b-1][1] += 1
  end
end
pt.sort!{|a,b| b[1]<=>a[1]}
ans = Array.new(0)
for i in 0..(n-1)
  if i > 0 && pt[i-1][1] == pt[i][1]
    ans[pt[i][0]] = ans[pt[i-1][0]]
  else
    ans[pt[i][0]] = i+1
  end
end
for i in 0..(n-1)
  puts ans[i]
end
