N = gets.to_i
arr = Array.new() { Array.new() }
score_arr = Array.new(N) { |i| i = 0 }


while (line = gets) do
  arr << line.split.map(&:to_i)
end

arr.each do |a|
  n = a[2] - a[3]
  if n > 0
    score_arr[a[0]-1] += 3
  elsif n < 0
    score_arr[a[1]-1] += 3
  else
    score_arr[a[0]-1] += 1
    score_arr[a[1]-1] += 1
  end
end

score_arr.map.with_index(1) { |score, i| [i,score] }.sort_by!{|num| num[1] * -1}.map{|arr| p arr[0]}