import Control.Applicative
import Control.Monad
import Data.List
 
main = do
  n <- readLn
  xs <- replicateM n getLine
  putStr . sort . foldl1 f $ xs
 
f (x:xs) ys
  | x `elem` ys = (x :) . f xs . delete x $ ys
  | otherwise = f xs ys
f _ _ = []