import Control.Applicative( (<$>))
import Data.List( sort, group, transpose)
import Control.Monad( replicateM)

main = do   
    n_ <- readLn::IO Int
    ss_ <- replicateM n_ getLine
    let
	smallLetters = ['a'..'z']

	processedSS = (smallLetters++) <$> ss_

	letterDistribution = countLetter <$> processedSS

	countLetter s = count' <$> (group . sort $ s)
	  where
	    count' = (subtract 1) . length

	result = minimum <$> transpose letterDistribution

	lender _ [] = []
	lender c (n:ns) = (replicate n c)++(lender (succ c) ns)

    putStr $ lender 'a' result