import Control.Monad
cs = ['a' .. 'z']

solve :: [String]->Char->(Char,Int)
solve ss c = (c, minimum $ map (length . filter (== c)) ss)

unpack :: [(Char,Int)] -> String
unpack [] = []
unpack ((c,n):cs) = (unpack cs) `mappend` (replicate n c)

main = do
  n <- readLn
  ss <- replicateM n getLine
  let
    ts = (map (solve ss) cs)
    in putStrLn $ reverse $ unpack ts
