module Main where import Data.List import Data.Ratio trd3 (_, _, c) = c main = do _ <- getLine ts <- map read . words <$> getLine ds <- map read . words <$> getLine putStrLn . unwords . map (show . trd3) . sort $ zipWith3 (\ t d i -> (d % t :: Ratio Int, - t, i)) ts ds [1 ..]