import           Control.Monad
import qualified Data.ByteString.Char8       as BS
import           Data.Char
import           Data.Maybe
import qualified Data.Vector.Unboxed         as V
import qualified Data.Vector.Unboxed.Mutable as VM

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
  n <- getInt
  ss <- replicateM n BS.getLine

  let siz = ord 'z' - ord 'a' + 1

  hmin <- VM.new siz
  VM.set hmin (10^9::Int)

  h <- VM.new siz

  let countS [] = return ()
      countS (s:xs) = do
        VM.set h (0::Int)
        forM_ [0..(BS.length s - 1)] $ \i -> do
          let c = BS.index s i
              j = ord c - ord 'a'
          m <- VM.read h j
          VM.write h j (m+1)
        forM_ [0..(siz-1)] $ \i -> do
          x <- VM.read hmin i
          y <- VM.read h i
          VM.write hmin i (min x y)
        countS xs

  countS ss

  hmin' <- V.freeze hmin
  
  putStrLn $
    concatMap
    (\c -> take (hmin' V.! (ord c - ord 'a')) (repeat c))
    ['a'..'z']