import Control.Monad
import Control.Monad.State
import qualified Data.Map as Map
import qualified Data.List as List

type AlpMap = Map.Map Char Int
type AlpState = State AlpMap Int

nan :: Int
nan = 51

main :: IO ()
main = do
  n <- readLn :: IO Int
  strs <- replicateM n getLine
  putStrLn $ solve strs

solve :: [String] -> String
solve strs = map2Str $ execState  (update inputs) initMap
  where
    inputs :: [[(Char, Int)]]
    inputs = map (toInput .
                  List.group . List.sort)
             strs
    initMap :: AlpMap
    initMap = Map.fromList $ zip ['a','b'..'z'] $ repeat nan

toInput :: [String] -> [(Char, Int)]
toInput str = go str ['a'..'z']
  where
    go [] ss = zip ss $ repeat 0
    go _ [] = []
    go (x:xs) (y:ys) =
      case head x of
         _ | y == head x -> (y, length x) : go xs ys
         _  -> (y, 0) : go (x:xs) ys

update :: [[(Char, Int)]] -> AlpState
update [] = do
  return 0
update (s:ss) = do
  _ <- upd s
  update ss
  where
    upd :: [(Char, Int)] -> AlpState
    upd [] = return 0
    upd ((c, i):is) = do
      i' <- gets (Map.lookup c)
      case i' of
        Nothing -> upd is
        Just y -> do
          modify (Map.insert c (min i y))
          upd is
    
map2Str :: AlpMap -> String
map2Str = Map.foldWithKey (\k a b -> if a == nan
                                     then b
                                     else replicate a k ++ b) []
