import qualified Control.Monad as C
import qualified Data.List as L

main = do
    n <- read <$> getLine :: IO Int
    (s:ss) <- map L.sort <$> C.replicateM n getLine :: IO [String]
    putStrLn $ foldr merge s ss

merge [] _ = []
merge _ [] = []
merge (s:ss) (s':ss') = case (s == s') of
    True -> s:merge ss ss'
    _    -> merge ss ss'
