n=gets.chomp.to_i
n1=n*(n-1)/2
i=0
count=[0,0,0,0]
n1.times do |i|
  m =gets
  m=m.split.map(&:to_i)
  a=m[0]-1
  b=m[1]-1
  if m[2]>m[3]
    count[a]+=3
  elsif m[2]==m[3]
    count[a]+=1
    count[b]+=1
  else
    count[b]+=3
  end
end

count2=count.sort.reverse
n.times do |i|
  n.times do |j|
    if count[i]==count2[j]
      p j+1
      break
    end
  end
end