import Data.List (sort)
import Control.Monad (forM)

main = do
  _ <- read <$> getLine :: IO Int
  ss <- map sort.lines <$> getContents :: IO [String]
  sss <- forM "abcdefghijklmnopqrstuvwxyz" $ \c ->
            return $ map (takeWhile (==c).dropWhile (/=c)) ss
  let ls = map (minimum.map length) sss
      ans = concat $ zipWith (\l x-> take l$repeat x) ls "abcdefghijklmnopqrstuvwxyz"
  putStrLn ans
