import           Control.Monad
import           Data.List
import           Data.Ord
import           Data.List.Split
import qualified Data.Vector.Unboxed as V

solve :: [String] -> [[Int]]
solve [] = []
solve (s:ss) = f s:solve ss
  where
    f s = map (\a -> length (elemIndices a s)) ['a' .. 'z']

count :: [[Int]] -> [Int] -> [Int]
count iss xs = foldl (flip (zipWith min)) xs iss

create :: [Int] -> String -> String
create [] _ = []
create (c:cs) (x:xs) = replicate c x ++ create cs xs

main :: IO ()
main = do
  n <- readLn
  ss <- replicateM n $ sort <$> getLine
  let cs = solve ss
      as = count cs (replicate 26 50)
  putStrLn $ create as ['a' .. 'z']
