import Control.Applicative
import Control.Monad
import Data.List
import qualified Data.Map.Strict as M

f :: String -> [(Char, Int)]
f xs = fmap (\a@(y:_) -> (y, length a)) . group . sort $ xs

g :: String -> M.Map Char Int
g xs = M.fromList (f xs)

main :: IO ()
main = do
    n <- readLn
    xss <- replicateM n getLine
    let m1 = fmap g xss
    let m2 = foldr1 (M.intersectionWith min) m1
    let ans = sort . concat $ M.foldrWithKey (\k a acc -> replicate a k : acc) [] m2
    putStrLn ans