import Control.Applicative
import Control.Monad
import Data.Functor
import Data.List
import Data.Function

readInts = map read . words <$> getLine :: IO [Int]

solve ds = map fst $ sortBy (compare `on` snd) $ zip [1..] $ map (\[s, p] -> (s, (-read p))) ds

main = readLn >>= flip replicateM (words <$> getLine) >>= mapM_ print . solve
