n = gets.to_i
t = [0] * n
(n*(n-1)/2).times {
  a,b,x,y = gets.split.map(&:to_i)
  if x == y
    t[a-1] += 1
    t[b-1] += 1
  elsif x > y
    t[a-1] += 3
  else
    t[b-1] += 3
  end
}
result = t.map.with_index.to_a.sort_by{|item| -item[0]}
rank = []

r = 0
last = nil
result.each.with_index {|item, i|
  score, _ = item
  if last == score
    rank << r
  else
    rank << i + 1
    r = i + 1
  end
  last = score
}

result.zip(rank).map {|item| [item[0][1], item[1]]}.sort_by{|item| item[0]}.to_a.each{|item|
  p item[1]
}

