test_case = gets.chomp.to_i res, rank = Array.new, Array.new num = 0 test_case.times do |i| point = gets.chomp.to_i num = point if i == 0 rank << point res << rank.sort{|a, b| b <=> a }.index(num) + 1 end puts res