import Control.Monad
main = do
  n <- readLn :: IO Int
  xs <- replicateM n getLine :: IO [String]
  putStrLn $ solve xs ['a'..'z']

solve :: [String] -> String -> String
solve xs [] = []
solve xs (c:cs) = 
  (replicate l c) ++ solve xs cs
  where l = foldl1 (\a b -> min a b) $ map (length . filter(==c)) xs