import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Control.Monad.ST
import Data.List
import Data.Array.ST
import Data.Array
import Data.Maybe (fromJust)
import Debug.Trace


increment :: (STArray s Char Int) -> Char -> ST s (STArray s Char Int)
increment arr c = do
    v <- readArray arr c
    writeArray arr c (v + 1)
    return arr

countAlphabets :: String -> [Int]
countAlphabets str = elems (runSTArray $ do
    arr <- newArray ('a', 'z') 0
    forM_ str (increment arr)
    return arr)

createMinList :: [Int] -> [Int] -> [Int]
createMinList [] [] = []
createMinList (a:ax) (b:bx) = m:(createMinList ax bx)
    where
        m = min a b

createMinCounts :: [[Int]] -> [Int]
createMinCounts arr =
    foldl createMinList (replicate 26 10000) arr

createStringFromCount :: Char -> [Int] -> String
createStringFromCount _ [] = ""
createStringFromCount c (x:xs) = (replicate x c) ++ (createStringFromCount next xs)
    where
        next = toEnum ((fromEnum c) + 1) :: Char

solve :: [String] -> String
solve arr =
    createStringFromCount 'a' $ createMinCounts $ map countAlphabets arr

main :: IO ()
main = do
    n <- fst . fromJust . BS.readInt <$> BS.getLine
    arr <- replicateM n (BS.unpack <$> BS.getLine)
    putStrLn $ solve arr
