import Control.Monad
import qualified Data.Map as M
main = do
  n <- readLn
  ss <- replicateM n getLine
  putStrLn 
    $concatMap (uncurry (flip replicate))
    $ M.toList $ foldl1 (M.intersectionWith min) 
    $ map (M.fromListWith (+) . flip zip (repeat 1)) ss