n = gets.to_i
points = Array.new(n, 0)
while line = gets
    a, b, c, d = line.chomp.split.map(&:to_i)
    if c > d
        points[a - 1] += 3
    elsif c < d
        points[b - 1] += 3
    else
        points[a - 1] += 1
        points[b - 1] += 1
    end
end

team = Hash.new{|h, k| h[k] = []}
points.each_with_index{|point, i|
    team[point] << i
}

result = []
rank = 1
points.sort.reverse.uniq.each{|point|
    team[point].each{|t| result[t] = rank}
    rank += team[point].length
}
puts result
