import Control.Monad

convertStrToInt :: String -> [Int]
convertStrToInt xs = head $ forM ['a'..'z'] $ \i -> return $ length $ filter (== i) xs

convertIntToStr :: [Int] -> String -> String
convertIntToStr [] _ = []
convertIntToStr _ [] = []
convertIntToStr (x:xs) (y:ys) = replicate x y ++ (convertIntToStr xs ys)

minNums' :: [Int] -> [Int] -> [Int]
minNums' [] _ = []
minNums' _ [] = []
minNums' (x:xs) (y:ys) = min x y : minNums' xs ys

minNums :: [[Int]] -> [Int]
minNums [x] = x
minNums (x:y:zs) = minNums ((minNums' x y) : zs)

main = do
  num <- fmap read getLine :: IO Int
  strs <- replicateM num $ do
            tempStr <- getLine
            return tempStr
  putStrLn $ convertIntToStr (minNums $ map convertStrToInt strs) ['a'..'z']
