import qualified Data.Vector as V
import qualified Data.ByteString.Char8 as B
import Data.List
import qualified Data.Map as M
import Control.Monad

solve :: M.Map Int [B.ByteString] -> B.ByteString -> Int -> M.Map Int [B.ByteString]
solve m b i = 
    case M.lookup i m of
        Just bs ->
            if b `elem` bs
                then solve m b (i+1)
                else M.adjust (b:) i m
        Nothing -> M.insert i [b] m

main = do
    n <- readLn :: IO Int
    strs <- V.replicateM n B.getLine
    let m = V.foldl' (\m s -> solve m s 1) M.empty strs
    let ((_, bs), _) = M.deleteFindMax m
    forM_ (sort bs) $ \b -> putStrLn $ B.unpack b