import Data.Maybe
import Control.Monad
import qualified Data.Map as M

type Map = M.Map Char Int

setMin :: Char -> Int -> Map -> Map
setMin c count m = case M.lookup c m of
                     Just x  -> if count < x
                                then M.insert c count m
                                else m
                     Nothing -> M.insert c count m

check :: String -> Map -> String -> Map
check [] m _ = m
check (a:as) m s = check as (setMin a count m) s
  where count = length $ filter (==a) s

main :: IO ()
main = do
  n <- readLn
  ss <- replicateM n getLine
  let res = filter ((>0) . snd) . M.toList $ foldl (check ['a'..'z']) M.empty ss
  putStrLn . concat $ map (\x -> replicate (snd x) (fst x)) res